5 Replies Latest reply on Jul 10, 2010 8:49 AM by Bill Gravette

    [BPMN2] Service Task input/output

    Ronald van Kuijk Master

      In the code in SVN, I see that Bernd stated:

       // inputs
       Data inputData = null; // more than one allowed in BPMN 2
       List<Assignment> inputAssociation = new ArrayList<Assignment>();
      
       // outputs
       Data outputData = null; // more than one allowed in BPMN 2
       List<Assignment> outputAssociation = new ArrayList<Assignment>();
      


      But the docs say:

      v 0.9.15 wrote:

      inMessageRef: Message
      This attribute specifies the input Message of the Operation. An Operation has exactly one input Message.

      outMessageRef: Message [0..1]
      This attribute specifies the output Message of the Operation. An Operation has at most one input Message.


      Now Bernd has taught me that the spec is always right, But his comment in the code makes me doubt. It's so explicit.


        • 1. Re: [BPMN2] Service Task input/output
          Ronald van Kuijk Master

          Can it be you 'confused it with the dataInput/Output?

          • 2. Re: [BPMN2] Service Task input/output
            Ronald van Kuijk Master

            Ok, a more concrete example of the 'interface' for the java service task
            The serviceTask gets the 'implementation="other"' and references an operation. From there we can do the following:

             <bpmn:interface id="interface21"
             name="org.jbpm.example.bpmn.ServiceTaskTest">
             <bpmn:operation id="operation42" name="doSomething">
             <bpmn:inMessageRef>inputMessage</bpmn:inMessageRef>
             <bpmn:outMessageRef>outputMessage</bpmn:outMessageRef>
             </bpmn:operation>
             </bpmn:interface>
            
             <bpmn:message id="inputMessage" name="input message"
             structureRef="itemDefinition1"></bpmn:message>
            
             <bpmn:message id="outputMessage" name="output message"
             structureRef="itemDefinition2"></bpmn:message>
            
            
             <bpmn:itemDefinition id="itemDefinition1"
             structureRef="jbpm:Java">
             <jbpm:arg>
             <jbpm:object expr="#{joesmoe.handshakes.force}" />
             </jbpm:arg>
             <jbpm:arg>
             <jbpm:object expr="#{joesmoe.handshakes.duration}" />
             </jbpm:arg>
             </bpmn:itemDefinition>
            
             <bpmn:itemDefinition id="itemDefinition2"
             structureRef="jbpm:Java">
             <jbpm:return>
             <jbpm:object expr="#{hand}" />
             </jbpm:return>
             </bpmn:itemDefinition>
            


            But we could also put things more directly under the operation to circumvent this BPEL/WSDL overhead.

            Any thoughts?

            • 3. Re: [BPMN2] Service Task input/output
              Bernd Ruecker Master

               


              // more than one allowed in BPMN 2

              This related to the dataInput int the service usage (ioSpecification if I remember it right). The interface doesn't have that.

              The code you proposed looks right to me.

              • 4. Re: [BPMN2] Service Task input/output
                Ronald van Kuijk Master

                I think that according to the spec a itemDefinition element is not required, so the following is allowed to.

                 <bpmn:interface id="interface21"
                 name="org.jbpm.example.bpmn.ServiceTaskTest">
                 <bpmn:operation id="operation42" name="doSomething">
                 <bpmn:inMessageRef>inputMessage</bpmn:inMessageRef>
                 <bpmn:outMessageRef>outputMessage</bpmn:outMessageRef>
                 </bpmn:operation>
                 </bpmn:interface>
                
                 <bpmn:message id="inputMessage" name="input message">
                 <jbpm:arg>
                 <jbpm:object expr="#{joesmoe.handshakes.force}" />
                 </jbpm:arg>
                 <jbpm:arg>
                 <jbpm:object expr="#{joesmoe.handshakes.duration}" />
                 </jbpm:arg>
                 </bpmn:message>
                
                 <bpmn:message id="outputMessage" name="output message">
                 <jbpm:returnVal name="hand">
                 </bpmn:message>
                


                Which would in most cases be sufficient.

                • 5. Re: [BPMN2] Service Task input/output
                  Bill Gravette Newbie

                  Does anyone have any background on why the <jbpm: arg> extension is still required for passing parameters into a ServiceTask with Java implementation? It seems that this would be natively supported in BPMN.