5 Replies Latest reply on May 10, 2013 3:58 PM by David Ward

    Switchyard invoking BPM signal-event

    Dave Kes Newbie

      Where can I find more information on using a signal-event in a Switchyard BPM process? I am looking for examples or documentation.

       

      I have a very simple process with START_PROCESS and SIGNAL_EVENT action types. The START_PROCESS works fine. It invokes the BPM process correctly.

      However, the SIGNAL_EVENT operation does not seem to invoke the signal event in my BPM process.

       

      In Switchyard I have mapped the correct operation name to the SIGNAL_EVENT action type.

      I am wondering how the incoming message in Switchyard is mapped to the correct event in my BPM process? Do I have to do anything with the eventType in BPM? I have read something about changing the tooling generated ID? What is this all about?

       

      What am I missing in the mapping of the Switchyard configuration to the BPM signal-event?

       

      kind regards,

      Dave Kes

        • 1. Re: Switchyard invoking BPM signal-event
          David Ward Master

          The event id that shows up in the tooling is actually the signalRef in the bpmn2 file.  So, if you have this in bpmn2:

           

          <signalEventDefinition id="SignalEventDefinition_1" signalRef="test"/>

           

          Then do this in your switchyard.xml:

           

          <implementation.bpm...>

              <actions>

                  <action id="test" operation="myOperation" type="SIGNAL_EVENT">

                  </action>

              </actions>

              ...

          </implementation.bpm>

           

          If this doesn't work for you, please attach your bpmn2 and switchyard.xml files.

          • 2. Re: Switchyard invoking BPM signal-event
            Dave Kes Newbie

            Hi David,

             

            I think I am still doing something wrong. It does not seem to work.

            In my switchyard file I added the ID attribute according to the signalRef in the bpmn file.

             

            See attached my switchyard.xml and bpmn file.

             

            A process instance is started by invoking the submitOrder operation. In the SOAP message I added a processInstanceId field.

            In a subsequent SOAP call I invoke the receiveOrderAcknowledgement operation which is supposed to invoke the signal event in my bpmn process.

             

            In the Switchyard message trace I can see that Switchyard receives the message correctly. Unfortunatelly, the Task script in the bpmn process is not invoked.

             

            Do I perhaps have to pass the processInstanceId to the bpmn process? Or do I also have to add an extra SOAP header field like processEvent? Should the process be persistent?

            What am I missing in my configuration?

             

            thanks!

            • 3. Re: Switchyard invoking BPM signal-event
              David Ward Master

              When you start a process instance, the response soap message will have the newly created processInstanceId in the soap headers.  You HAVE to send that back in the subsequent (signalling) request as a soap header, otherwise SwitchYard (and thus jBPM) won't know which process instance to signal.

               

              Try that, and if you still have problems, please copy/paste here your MessageTrace output from both of your requests/responses.

               

              Aside, if you are using SwitchYard 0.8, you don't have to have the <workItemHandlers> section in your switchyard.xml.  The SwitchYard runtime now always auto-registers the SwitchyardServiceWorkItemHandler.

              • 4. Re: Switchyard invoking BPM signal-event
                Dave Kes Newbie

                Hi David,

                 

                Your signalRef-id suggestion did the trick!

                 

                Apparently, I had to solve some other problems before it worked:

                - I changed back the SOAP Header Type from XML to Value (unwrapped payload)

                - I printed the process instance ID in a task in my processflow (kcontext.getProcessInstance().getId()), to make sure I passed the correct processInstanceId in order to invoke the event in my flow.

                - My JAXB tranformation failed, so the bpmn process was not reached.

                 

                Thanks for your help!

                • 5. Re: Switchyard invoking BPM signal-event
                  David Ward Master

                  No problem. Glad it's working for you now!