9 Replies Latest reply on Jun 1, 2012 3:40 AM by objectiser

    BPMN2 SwitchyardServiceTask vs ServiceTask

    objectiser

      Hi

       

      In Savara I have some tooling for generating BPMN2 process models from choreographies and scenarios. Currently I use the ServiceTask for synchronous invocations - however noticed that Switchyard uses its own type of ServiceTask to invoke other services defined in the app.

       

      Just wondering the reason for this? Are there any technical reasons why a standard ServiceTask cannot be supported, as it would make executing standard BPMN2 process models within switchyard much easier.

       

      Regards

      Gary

        • 1. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
          dward

          In the original BPMN2 eclipse plugin, there was no basic Service Task provided in the palette, so I created one. While recently upgrading to jBPMN 5.3.0.Final, I also upgraded to the newer BPMN2 eclipse plugin, which now has that task on the pallette. I will look into it, but have other priorities to work out for our upcoming 0.5 release first.  I don't have any experience with what the Savara tooling provides.  Point me to any relevant URLs please?  Thank you.

          • 2. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
            dward

            Here is a screenshot of the original plugin (with palette).

            • 3. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
              objectiser

              Hi David

              David Ward wrote:

               

              In the original BPMN2 eclipse plugin, there was no basic Service Task provided in the palette, so I created one. While recently upgrading to jBPMN 5.3.0.Final, I also upgraded to the newer BPMN2 eclipse plugin, which now has that task on the pallette. I will look into it, but have other priorities to work out for our upcoming 0.5 release first.  I don't have any experience with what the Savara tooling provides.  Point me to any relevant URLs please?  Thank you.

              That would be great if the standard ServiceTask could be used - its not urgent, so post 0.5 is fine. Just planning ahead to understand what I would need to do to create an executable BPMN2 process model for running in switchyard/jbpm.

               

              Probably best source of info for a quick overview is the Eclipse user guide: http://docs.jboss.org/savara/releases/2.1.x/eclipseuserguide/html/index.html - also http://www.jboss.org/savara/ta.html provides an overview of the goals of the project.

               

              Thanks.

               

              Regards

              Gary

              • 4. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                jeffdelong

                David,

                 

                When you said "the newer BPMN2 eclipse plugin" do you mean

                  BPMN2 Editor0.0.1.201205212015org.eclipse.bpmn2.modeler.feature.feature.groupEclipse.org

                 

                Here is a snapshot of a BPMN2 Process representing the Store service that is generated from a BPMN2 Choreography

                 

                store-bpmn2.png

                 

                 

                And here is the choreography model this process is generated from:

                 

                purchasing-bpmn2.png

                 

                Savara can also generate other types of SwitchYard services, e.g. the Logistics service could be generated as a java bean-service.

                • 5. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                  dward

                  Thanks Gary. I'll read up.

                  • 6. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                    dward

                    Jeff, yes - that's the one.

                     

                    Oooh, although looks like there's a slightly newer version (after askign eclispe to look for updates)...

                    • 7. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                      dward

                      Gentlemen, I've created a jira to keep track of this: https://issues.jboss.org/browse/SWITCHYARD-827

                      • 8. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                        jeffdelong

                        The selection of a particular type of task tells jBPM which WorkitemHandler to invoke when the task is reached. This is done through either the element name, for example

                         

                           <scriptTask id="ScriptTask_2" name="Script Task" scriptFormat="http://www.java.com/java" >

                         

                        Or for custom tasks, such as the current SwitchYard Service the taskName attribute in the task element. For example

                         

                         

                           <task id="_5" tns:taskName="SwitchYard Service" name="S2bJDBSCallService">

                         

                        When the process gets to this task it calls org.switchyard.component.bpm.task.work.SwitchYardServiceTaskHandler which then invokes the actual SwitchYard service

                         

                        The PurchaseGoods_Store.bpmn currently has a ServiceTask defined:

                         

                           <bpmn2:serviceTask id="e3eed0fb-2fbb-483f-b005-83f4447076b7" name="Service: delivery(DeliveryRequest) to Logistics" operationRef="OP_Logistics_delivery">

                              <bpmn2:incoming>f6777dc7-d110-41c0-a6d8-a9c17eea59b8</bpmn2:incoming>

                              <bpmn2:outgoing>df9399c5-f26a-42b0-a337-198bce48d1c3</bpmn2:outgoing>

                            </bpmn2:serviceTask>

                         

                        However, jBPM5 would not know how to execute this task, i.e., there is no WorkitemHandler that would understand how to invoke the Logistics Service. We need to figure out how this would invoke the SwitchYardServiceTaskHandler, whose configuration includes ServiceName and ServiceOperationName.

                         

                        There is also some discussion in the jBPM email lists about creating a generic Web Service ServiceTask implementation. So if we use the ServiceTask, we need to be able to specify the implementation, e.g. WebService, SwitchYard, etc.

                        • 9. Re: BPMN2 SwitchyardServiceTask vs ServiceTask
                          objectiser

                          For a standard ServiceTask, it should be possible to follow the "operationRef" to the definition of the Operation on an Interface within the model. The Interface also has an optional "implementationRef" which can be used to point to the concrete interface definition (e.g. WSDL port type) - so the operation name can be obtained from the referenced Operation, and the port type from the "implementationRef" QName, without actually resolving the WSDL.

                           

                          So if it is possible for switchyard to register a default handler against the ServiceTask itself, then it should be possible to route messages to any other services with a WSDL interface. It may also be possible to use a java URI in the "implementationRef" field to allow Java interfaces to be used directly.