7 Replies Latest reply: Mar 7, 2013 9:09 AM by 975124 RSS

    Matching of External Event in OSM automation task without request sent.

    Bharathi
      Hi All,

      I want to implement an automation task with only response plugin which will be used to listen for an external event. How to match the event from external system to related order in OSM as there is no request being sent and cant have JMSCorrelationID as MessagePropertySelecor to match the event with the order.

      Can anyone Pls help me on this implemention, it would be greatful if I get quick solution.

      Thanks in advance
      Bharathi R
        • 1. Re: Matching of External Event in OSM automation task without request sent.
          975124
          it seems you are creating a receiver without sending message.
          to do so,
          Create an automation with type internal automator.
          get the correlator, and add the correlationid to it.

               if it is xquery then code snippet like below

                    declare namespace correlator = "java:com.mslv.oms.automation.Correlator";
                    let $correlator := automator:getCorrelator($automator, $context)
                    correlator:add($correlator,'1011')

          When an automation send message to an queue, it automatically add the correlation id to the correlation table in osm schema.
          By this information in table OSM receivers correlates responses.
          Here there is no sender plugin so we have to add the correlation id for this task context to receive the message with same correlation id.
          And one more thing, you can not create receiver plugins for any kind or event automation.
          it should be Task automation.
          Hope it will help you.

          Edited by: tarini.samal on Mar 3, 2013 4:33 PM
          • 2. Re: Matching of External Event in OSM automation task without request sent.
            Bharathi
            Hi Tarini,

            Thanks a lot for your input.

            Could you please elaborate on the folwoing queries, so that it would be helpful for me to understand more.

            1) Is it enough to have single plugin with XSLTAutomator Internal Event Receiver to achieve this requirement?

            2) What is corrletor here that we need to get and add it with correlationid?

            3) Do we need to add this corrleationid in the above mentioned automation task?

            It would be more helpful if you give xsl example.

            Your quick reply will be more appriciated.

            Thanks in advance
            Bharathi R
            • 3. Re: Matching of External Event in OSM automation task without request sent.
              975124
              XSLTAutomator Internal Event Receiver has to be added to Automated task to set the correlation id with context, for the receiver to receive message with same correlation id, present in the same task.
              correlator is the osm java api provided to set correlation id.

              you have to call java from xlst to use this.

              sample

              xmlns:correlatorns ="com.mslv.oms.automation.Correlator"

              <xsl:variable name="correlator" select="automator:getCorrelator($automator, $context)"/>
              <xsl:variable name="void" select="correlatorns:add($correlator,'1011')"/>
              • 4. Re: Matching of External Event in OSM automation task without request sent.
                Bharathi
                Hi Tarini,

                I have created an XSLT Automator with Internal Event Receiver, and tested the cartridge but facing issue with the xsl. Kindly help on this to resolve.

                Please find below xsl:

                <xsl:stylesheet version="1.0" xmlns="http://java.sun.com/products/oss/xml/ServiceActivation"
                xmlns:oms="urn:com:metasolv:oms:xmlapi:1"
                xmlns:correlatorns="com.mslv.oms.automation.Correlator"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:java="http://xml.apache.org/xalan/java" xmlns:xalan="http://xml.apache.org/xalan"
                xmlns:mslv-sa="http://www.metasolv.com/oss/ServiceActivation/2003"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:co="http://java.sun.com/products/oss/xml/Common"
                exclude-result-prefixes="oms java xsl xalan correlatorns">
                <xsl:param name="automator"/>
                <xsl:param name="log"/>
                <xsl:param name="context"/>
                <xsl:param name="outboundMessage"/>
                <!-- * -->
                <xsl:output method="xml" indent="yes" omit-xml-declaration="no" xalan:indent-amount="5"/>
                <!-- * -->
                <xsl:template match="/">
                <xsl:variable name="correlator" select="automator:getCorrelator($automator, $context)"/>
                <xsl:variable name="voidCorrelator" select="java:info($log, concat('correlator value is###',$correlator))" />
                <xsl:variable name="void" select="correlatorns:add($correlator,'ES12345-0_248_WARESHOUSE')"/>
                <xsl:variable name="exit" select="java:setExitStatus($automator, 'success')"/>
                </xsl:template>
                </xsl:stylesheet>


                Error Log:

                at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
                at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
                at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
                at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
                at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:155)
                at org.apache.xpath.XPath.<init>(XPath.java:225)
                at org.apache.xalan.processor.StylesheetHandler.createXPath(StylesheetHandler.java:152)
                at org.apache.xalan.processor.XSLTAttributeDef.processEXPR(XSLTAttributeDef.java:761)
                at org.apache.xalan.processor.XSLTAttributeDef.processValue(XSLTAttributeDef.java:1404)
                at org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(XSLTAttributeDef.java:1600)
                at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:338)
                at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:263)
                at org.apache.xalan.processor.ProcessorTemplateElem.startElement(ProcessorTemplateElem.java:76)
                at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:623)
                at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
                at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
                at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
                at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
                at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:920)
                at oracle.communications.ordermanagement.automation.plugin.c.newTemplates(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.n.a(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.k.a(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.a(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.transform(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.runCommonFunctionality(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.ScriptRunnerImpl.runScript(Unknown Source)
                at oracle.communications.ordermanagement.automation.plugin.AbstractScriptAutomator.run(Unknown Source)
                at com.mslv.oms.automation.plugin.AbstractAutomator._runAutomator(Unknown Source)
                at com.mslv.oms.automation.plugin.SetCorrId_SetCorrIdPlugin_2vjt88_EOImpl._runAutomator(SetCorrId_SetCorrIdPlugin_2vjt88_EOImpl.java:205)
                at com.mslv.oms.automation.plugin.SetCorrId_SetCorrIdPlugin_2vjt88_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.automation.plugin.SetCorrId_SetCorrIdPlugin_2vjt88_EOImpl_1031_WLStub._runAutomator(Unknown Source)
                at com.mslv.oms.automation.AutomationDispatcher.a(Unknown Source)
                at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.processMessage(Unknown Source)
                at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage(Unknown Source)
                at com.mslv.oms.automation.plugin.AutomationEventHandlerImpl.a(Unknown Source)
                at com.mslv.oms.automation.plugin.c.a(Unknown Source)
                at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage(Unknown Source)
                at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
                at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4585)
                at weblogic.jms.client.JMSSession.execute(JMSSession.java:4271)
                at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5096)
                at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:22)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)


                Thanks in advance
                Bharathi R
                • 5. Re: Matching of External Event in OSM automation task without request sent.
                  975124
                  HI

                  I think you may be checked update order in automation.
                  here in your xslt you are not updating anything.
                  use this <xsl:variable name="void2" select="java:setUpdateOrder($context,"false")"/>
                  and


                  <xsl:variable name="correlator" select="automator:getCorrelator($automator, $context)"/>

                  as
                  <xsl:variable name="correlator" select="java:getCorrelator($automator, $context)"/>



                  regards
                  Tarini

                  Edited by: tarini.samal on Mar 6, 2013 1:05 AM

                  Edited by: tarini.samal on Mar 6, 2013 1:36 AM
                  • 6. Re: Matching of External Event in OSM automation task without request sent.
                    Bharathi
                    Hi Tarini,

                    Thanks, now task is completing successfully. But when tried to print correlationId value after add function, it is blank.
                    Please see below the code snippet.


                    <xsl:variable name="voidCorrelation" select="correlatorns:add($correlator,'ES12345-0_248_WARESHOUSE')"/>

                    <xsl:variable name="voidCorrelationId" select="java:info($log, concat('correlation Id value is###',$voidCorrelation))" />

                    Please confirm the syntax correlatorns:add() is proper. I hope this line will add correlationId in table, pls confirm my understanding.

                    Thanks in advance
                    Bharathi R
                    • 7. Re: Matching of External Event in OSM automation task without request sent.
                      975124
                      add method is void
                      it will not return anything.correlation has been set.
                      Your receiver now ready receive with new correlation id.
                      Place message with same coid to test