1 Reply Latest reply: Nov 8, 2012 4:34 AM by Viktor.Jarolim-Oracle RSS

    OSM: Error creating orchestration plan caused by NullPointerException

    485567
      Hi Guys,

      I created my tutorial orchestration cartridge, where I last time had this weird problem with disappearing creation task. That is fixed, but now after I deployed that and I fired an order I get this exception:
      <Nov 4, 2012 10:38:44 AM EST> <Error> <oms> <BEA-000000> <ws.f: Error processing createOrderBySpecification
      com.mslv.oms.OMSException: encountered error starting orchestration
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.a(Unknown Source)
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.process(Unknown Source)
      at com.mslv.oms.handler.a.processRequest(Unknown Source)
      at com.mslv.oms.handler.createorder.CreateOrderHandlerEJB.process(Unknown Source)
      at com.mslv.oms.handler.a.processRequest(Unknown Source)
      Truncated. see log file for complete stacktrace
      Caused By: oracle.communications.ordermanagement.orchestration.execution.OrchestrationExecutionException: Error creating orchestration plan
      at oracle.communications.ordermanagement.orchestration.execution.impl.i.a(Unknown Source)
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.a(Unknown Source)
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.process(Unknown Source)
      at com.mslv.oms.handler.a.processRequest(Unknown Source)
      at com.mslv.oms.handler.createorder.CreateOrderHandlerEJB.process(Unknown Source)
      Truncated. see log file for complete stacktrace
      Caused By: oracle.communications.ordermanagement.orchestration.generation.OrchestrationPlanGeneratorException: Could not create Orchestration Plan
      at oracle.communications.ordermanagement.orchestration.generation.ae.a(Unknown Source)
      at oracle.communications.ordermanagement.orchestration.generation.ac.a(Unknown Source)
      at oracle.communications.ordermanagement.orchestration.execution.impl.i.a(Unknown Source)
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.a(Unknown Source)
      at com.mslv.oms.handler.completeorder.CompleteOrderHandlerEJB.process(Unknown Source)
      Truncated. see log file for complete stacktrace
      Caused By: java.lang.NullPointerException
      at org.apache.commons.collections.CollectionUtils.getCardinalityMap(CollectionUtils.java:229)
      at org.apache.commons.collections.CollectionUtils.intersection(CollectionUtils.java:122)
      at oracle.communications.ordermanagement.orchestration.generation.v.a(Unknown Source)
      at oracle.communications.ordermanagement.orchestration.generation.j.a(Unknown Source)
      at oracle.communications.ordermanagement.orchestration.generation.j.a(Unknown Source)
      Truncated. see log file for complete stacktrace
      >

      Did you encounter this problem? What might be cause of this?

      My detailed steps how to create the cartridge are attached.

      Regards
      Peter

      howto.txt

      Create Folder TechTips

      in Design Studio choose from menu File->Switch Workspace->Other
      pick folder TechTips and press OK

      Close Subclipse Usage dialog window (uncheck Report usage) by OK

      Close Welcome screen

      Open from menu Studio -> Show Design Perspective

      Open from menu Studio -> Show Environment Perspective

      Right click on Environment area panel and choose New Studio Environment

      Answer Yes for Environment Project creation wizard

      Enter Project name TechTipsEnv and click Finish

      Switch to Studio Design Perspective by Window -> Open Perspective -> Studio Design or click on toolbar on Studio Design


      Right click on TechTipsEnv under Cartridge area panel and choose New -> Studio Environment

      Enter OSM into Name field and press Finish

      Change in Address field the default URL http://localhost:7001/cartridge/wsapi to your server. e.g. http://osssrv:7001/cartridge/wsapi
      press Save icon and close OSM tab

      Open from menu File -> New -> Project
      Expand Studio Wizards -> Order and Service Management and choose Order and Service Management Project
      Press Next and enter Project name MyCOM and press Finish

      Open cartridge details MyCOM -> MyCOM and switch to tab Cartridge Management Variables and press Add.
      Define new variable BUILD_DEPLOY_MODE with value optimized
      Press save


      Double Click on MyCOM -> Orders -> MyCOMOrder and click on tab Permissions and in Roles press New
      enter name MyRole and press Finish
      click on tab Details and in Lifecycle Policy press New, enter name MyOrderLifecycle and press Finish
      In Default Process press New and choose Orchestration Process, press Next, enter Name MyOrchProcess and in Namespace enter MyNamespace, press Finish
      You will get dialog with question "Confirm Import OSM Common Data Dictionary", click OK
      In newly opened tab MyOrchProcess in Orchestration Sequence, press New, enter Name MyOrchSequence and press Finish
      press save and close MyOrchProcess tab
      Double click on Orchestration Sequences -> MyOrchSequence and in Order Item press New, enter Name MyOrderItemSpec and press Finish

      In MyOrchSequence in Order Item Selector copy&paste into Expression area following:
      declare namespace tst="http://xmlns.oracle.com/tst";
      .//tst:test/tst:line


      In MyOrchSequence in Fulfillment Mode Expression copy&paste into Expression area following:
      <osm:fulfillmentMode name='COM_FulfillmentMode' namespace='MyNamespace'/>

      In MyOrchSequence in Orchestration Stages press New, enter Name MyStage and press Finish
      Press save and close MyOrchSequence tab

      Double click on Orchestration Stages -> MyStage and in Produces Order Component press New, enter Name MyFunction and press Finish
      Press save and close MyStage tab

      Open cartridge details MyCOM -> MyCOM and switch to tab Dependency and add Project OracleComms_OSM_CommonDataDictionary. press save and close tab MyCOM

      Double Click on MyCOM -> Data Schemas -> MyCOM
      In MyCOM right click in Data Element and pick Add Structure, enter name messageXmlData and press Finish
      In MyCOM right click in Data Element and pick Add Structure, enter name MyOrder and press Finish
      In MyCOM right click in Data Element and pick Add Structure, pick from Type by Select FulfillmentFunctionType type and press OK, enter name MyFunction and press Finish
      In MyCOM right click in Data Element and pick Add Element, enter name name and press Finish
      In above described way add two more elements ps and status
      Press save and close tab MyCOM

      In MyCOM -> Orders -> MyCOMOrder click on tab Order Template and right click and pick Select From Dictionary
      Select ControlData, messageXmlData and MyOrder and press OK
      Right click on ControlData->Functions and pick Select From Dictionary, Select MyFunction
      Right click on ControlData->OrderItem and pick Select From Dictionary, Select name
      In above described way add under OrderItem following two elements ps and status
      Right click on ControlData->Functions->MyFunction->orderItem and pick Add Reference Node
      Point it to ControlData->OrderItem and Enter name orderItemRef
      Right click on ControlData and pick Select From Dictionary, Select OrderFulfillmentState
      Right click on messageXmlData and pick Open Properties View, check XML Type, press OK
      Right click on MyOrder and pick Open Properties View, check XML Type, press OK
      Press save and switch to Details tab

      In Creation Task press New and enter name MyCreateTask, press Finish
      Press save and switch to tab Permissions and click on subtab Query Tasks, press New
      Pick Manual Task and press Next. Enter Name MyQueryTask and press Finish

      In MyQueryTask in Task Data tab right click and pick Select from Order Template, Select ControlData, messageXmlData, MyOrder, press OK
      Click on Permission tab, press Select and choose MyRole, press OK
      Press save and close MyQueryTask tab

      In MyCOMOrder, in tab Permissions, in subtab Query Tasks, check Detail and Default (summary is checked by default)
      Press save and close MyCOMOrder tab

      Double Click on MyCOM -> Manual Tasks -> MyCreateTask
      In Task Data tab, right click and pick Select from Order Template, Select ControlData, messageXmlData, MyOrder, press OK
      Click on Permission tab and press Select and choose MyRole, press OK
      Press save and close MyCreateTask tab

      Double click on MyCOM -> Order Component Specifications -> MyFunction
      In Process press New, enter Name MyFunctionProcess and press Finish
      In MyFunction choose Base Task by New and enter name MyFunctionCreateTask and press Finish
      Press save and close tab MyFunction

      Double Click on MyCOM -> Manual Tasks -> MyFunctionCreateTask
      Click on Permission tab and press Select and choose MyRole, press OK
      Press save and close tab MyFunctionCreateTask

      Double click on MyCOM -> Process -> MyFunctionProcess, drag and drop from right panel from Activities the End activity and Task activity.
      In newly opened dialog window enter in Name MyFunctionTask and press Finish
      Drag and drop from Flows a flow and connect start with MyFunctionTask.
      Drag and drop from flows the flows back, cancel, finish, next and connect MyFunctionTask with the End
      Press save and close tab MyFunctionProcess

      Double Click on MyCOM -> Manual Tasks -> MyFunctionTask
      In Task Data tab, right click and pick Select from Order Template, Select MyOrder
      Click on Permission tab and press Select and choose MyRole, press OK
      Press save and close tab MyFunctionTask


      Double Click on MyCOM -> Order Item Specifications -> MyOrderItemSpec
      In MyOrderItemSpec in subsection Order Item Properties create following properties by pressing Add:
      name
      ps
      status

      Pick for Product Specification Mapping Property the newly created property ps and for Order Item Name Property pick the property name.

      Click on name and enter into xquery following:
      'MyName'

      Click on ps and enter into xquery following:
      'PS_MySpec'

      Click on status and enter into xquery following:
      'OK'

      Press save and close tab MyOrderItemSpec


      Create Product Class by right click MyCOM -> New -> Product Class, enter Name Class_MyClass and press Finish
      In Class_MyClass in Product Specification press New, enter Name PS_MySpec and press Finish
      Press save and close tab Class_MyClass

      Double Click on MyCOM -> Product Specifications -> PS_MySpec
      In PS_MySpec in Fulfillment Mode in Fulfillment Modes area press New, enter name COM_FulfillmentMode and press Finish
      Press save and close tab PS_MySpec

      Double Click on MyCOM -> Roles -> MyRole
      Check all permission
      Press save and close tab MyRole


      Double Click on MyCOM -> Orders -> MyOrderLifecycle
      In Order Policy allow transaction Fail Order under state Not Started
      Click on Fail Order under Not Started and click on Add under permissions. Move role MyRole from Available roles to Selected
      Press save and close tab MyOrderLifecycle


      Create Order Recognition Rule by right click MyCOM -> New -> Order Recognition Rule, enter Name MyRecognitionRule and press Finish
      In MyRecognitionRule in tab Recognition choose for Target Order by clicking Select MyCOMOrder
      in Recognition Rule subsection enter xquery:
      true()

      In Input Message area press Select, pick messageXmlData and press OK
      Switch Transformation tab and enter in Order Data Rule subsection following xquery:
      xquery version "1.0";
      declare namespace tech="http://xmlns.oracle.com/TechNotes";

      <_root>
      <MyOrder>
      <tech:OrderId>12</tech:OrderId>
      </MyOrder>
      </_root>

      Press save and close tab MyRecognitionRule



      Open Menu and uncheck Project -> Build Automatically
      Choose from Menu Project -> Clean. Pick Clean All projects, check Start a build immediately and pick Build the entire workspace. Press OK

      Open Menu File->New->Other, expand General->Folder and press Next
      Pick parent folder MyCOM and enter Folder Name, samples, press Finish

      Open Menu File->New->Other, expand General->File and press Next
      Pick parent folder MyCOM/samples and enter File Name, myOrder.xml, press Finish

      In myOrder.xml click on tab Source and copy & paste following content:

      <?xml version="1.0" encoding="UTF-8"?>
      <ws:CreateOrder xmlns:ws="http://xmlns.oracle.com/communications/ordermanagement">
      <tst:test xmlns:tst="http://xmlns.oracle.com/tst">
      <tst:line/>
      <tst:line/>
      <tst:line/>
      </tst:test>
      </ws:CreateOrder>

      Press save and close tab myOrder.xml

      Open in web browser weblogic console e.g. http://osssrv:7001/console
      login as weblogic user
      Click on Security Realms -> myrealm -> Users and Groups and press New
      Enter name tutorial
      Password Passw0rd (retype)
      Press OK

      Click on tutorial user and click on tab Groups. Select all OMS*, OSM* and Cartridge_Management_WebService
      Press Save


      Now in Design Studio open Studio Environment perspective. Click on OSM and right click and pick Test Connection, enter username tutorial and password Passw0rd (confirm OK)

      Click on MyCOM and press Deploy (confirm OK)

      open sqlplus and login into ordermgmt schema
      execute sql command
      select WORKGROUP_ID from OM_WORKGROUPS where WORKGROUP_MNEMONIC = 'MyRole'

      returned id use in insert command
      insert into OM_USER_WORKGROUP (USERNAME, WORKGROUP_ID) values ('tutorial', value from previous sql)
      commit;

      Restart Weblogic server

      In Design Studio right click on MyCOM and choose Submit Test -> OSM -> myOrder.xml
      Enter username tutorial and password Passw0rd