1 Reply Latest reply on Apr 4, 2014 11:18 AM by Emerge

    getting com.mslv.oms.automation.AutomationException while updating Order data

    Emerge

      Hi

      I wrote a sample Xquery Automator with External Event Receiver.

       

      declare namespace oms = "urn:com:metasolv:oms:xmlapi:1";

      declare namespace log = "java:org.apache.commons.logging.Log";

      declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";

      declare namespace context = "java:com.mslv.oms.automation.TaskContext";

      declare namespace osm="http://xmlns.oracle.com/communications/ordermanagement";

      declare namespace saxon = "http://saxon.sf.net/";

      declare namespace xsl="http://www.w3.org/1999/XSL/Transform";

       

      declare variable $context external;

      declare variable $log external;

      declare variable $automator external;

       

       

      let $taskData := fn:root(.)/CRAMER.Response

      let $orderId := $taskData/CRAMERWOID

      let $jid := $taskData/CRAMERJOBID

                                           

      let $ordUpdateReqXML := (  

                                  <OrderDataUpdate xmlns="http://www.metasolv.com/OMS/OrderDataUpdate/2002/10/25">

                                      <Update path="/">

                                           <job_id>HC</job_id>

                                      </Update>

                                   </OrderDataUpdate>

                               )

      let $ordUpdateReqXMLStr := saxon:serialize($ordUpdateReqXML, <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" saxon:indent-spaces="4"/>)

       

      return(

      log:info($log, " ######### XML Transformed "),

      log:info($log, $ordUpdateReqXML),

      log:info($log, " ######### XML Transformed  after serialized"),

      log:info($log, $ordUpdateReqXMLStr),

      automator:setUpdateOrder($automator,"true"),

      context:updateOrderData($context,$ordUpdateReqXMLStr),

      context:completeTaskOnExit($context, "success")

      )


      but at runtime it throwing automation exception:

      Caused By: java.lang.NullPointerException

          at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.updateOrderData(Unknown Source)

      NOTE:- In Design Studio Automation Plugin Properties- Xquery Tab i tried with both options Order Data check box checked and unchecked.

      Please guide me whats wrong with my code.

      let me know if more info required on this.

       

      Thanks

       

      Stack Trace

      com.mslv.oms.automation.AutomationException

          at oracle.communications.ordermanagement.automation.plugin.AbstractExternalReceiverDispatcher.processMessage(Unknown Source)

          at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage(Unknown Source)

          at oracle.communications.ordermanagement.cluster.message.a.a(Unknown Source)

          at oracle.communications.ordermanagement.cluster.message.impl.a.a(Unknown Source)

          at oracle.communications.ordermanagement.cluster.message.impl.a.a(Unknown Source)

          at oracle.communications.ordermanagement.cluster.impl.a.a(Unknown Source)

          at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage(Unknown Source)

          at com.mslv.oms.security.base.ControllerBean.processExternalListenerAutomationMessage(Unknown Source)

          at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl.__WL_invoke(Unknown Source)

          at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)

          at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl.processExternalListenerAutomationMessage(Unknown Source)

          at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl_WLSkel.invoke(Unknown Source)

          at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)

          at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:222)

          at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl_1036_WLStub.processExternalListenerAutomationMessage(Unknown Source)

          at oracle.communications.ordermanagement.automation.plugin.AbstractExternalReceiverDispatcher.processMessage(Unknown Source)

          at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage(Unknown Source)

          at com.mslv.oms.automation.plugin.AutomationDispatcherImpl.a(Unknown Source)

          at com.mslv.oms.automation.plugin.AutomationDispatcherImpl$2.a(Unknown Source)

          at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage(Unknown Source)

          at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583)

          at weblogic.ejb.container.internal.MDListener.run(MDListener.java:902)

          at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)

          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)

          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

      Caused By: java.lang.NullPointerException

          at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.updateOrderData(Unknown Source)

        • 1. Re: getting com.mslv.oms.automation.AutomationException while updating Order data
          Emerge

          I got the solution, just need to set update order to false after updating order data

          below is the updated Xquery

           

          declare namespace oms = "urn:com:metasolv:oms:xmlapi:1";

          declare namespace log = "java:org.apache.commons.logging.Log";

          declare namespace automator = "java:oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";

          declare namespace context = "java:com.mslv.oms.automation.TaskContext";

          declare namespace osm="http://xmlns.oracle.com/communications/ordermanagement";

          declare namespace saxon = "http://saxon.sf.net/";

          declare namespace xsl="http://www.w3.org/1999/XSL/Transform";

           

          declare variable $context external;

          declare variable $log external;

          declare variable $automator external;

           

           

          let $taskData := fn:root(.)/CRAMER.Response

          let $orderId := $taskData/CRAMERWOID

          let $jid := $taskData/CRAMERJOBID

                                              

          let $ordUpdateReqXML := (  

                                      <OrderDataUpdate xmlns="http://www.metasolv.com/OMS/OrderDataUpdate/2002/10/25">

                                          <Update path="/">

                                               <job_id>HC</job_id>

                                          </Update>

                                       </OrderDataUpdate>

                                   )

          let $ordUpdateReqXMLStr := saxon:serialize($ordUpdateReqXML, <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" saxon:indent-spaces="4"/>)

           

          return(

          log:info($log, " ######### XML Transformed "),

          log:info($log, $ordUpdateReqXML),

          log:info($log, " ######### XML Transformed  after serialized"),

          log:info($log, $ordUpdateReqXMLStr),

          automator:setUpdateOrder($automator,true()),

          context:updateOrderData($context,$ordUpdateReqXMLStr),

          (: below line i added to solve the issue

          automator:setUpdateOrder($automator,false()),

          context:completeTaskOnExit($context, "success")

          )