[jboss-user] [jBPM] - Human Task Module SwitchYard Integration
do-not-reply at jboss.com
Tue Jul 10 05:49:09 EDT 2012
Mauricio Salatino [https://community.jboss.org/people/salaboy21] modified the document:
"Human Task Module SwitchYard Integration"
To view the document, visit: https://community.jboss.org/docs/DOC-18719
After providing a well defined set of Interfaces from the Human Task Module the next step is to expose those interfaces as services.
Leveraging the power of CDI and its integration with frameworks like Switchyard, Camel and JMS I will be doing some experiments to integrate these technologies together.
The main focus of this experiments is to remove the need of handling any transport related code inside the Human Task Module.
Providing Sync and Async integration points will allow the Human Task Module to keeps it focus in the internal logic that it handles without adding complexity related with integration.
This integration need to allows us to integrate the module in SE as well as EE environments. HornetQ (JMS implementation) will be used to demonstrate this functionality. Quartz will be used to show the scheduling capabilities that can also be offered by SwitchYard.
I've created a sample project showing how CDI services can be hooked up with Switchyard:
This project will show and demonstrate the following features:
#Exposing_a_Service_via_JMS Exposing a Service via JMS
#Sync_and_Async_services_calls Sync and Async services calls
#Creating_Clients Creating Clients
#Schedule_automatic_interactions Schedule automatic interactions
The human task module provides all the core logic required to manage human interactions. Using a set of services we will be able to create and interact with Human Tasks.
In order to make the integration from different application simplier a flexible mechanism for Async and Sync calls needs to be provided, without making the internal component logic a nightmare.
h1. Exposing a Service via JMS
In order to expose our CDI service using Switchyard we will need to choose a transport and do the corresponding bindings. For this service we have chosen JMS and we will be using HornetQ as our JMS provider.
>From the project dependencies perspective we need to add the following dependencies to our pom.xml file:
In order to expose our services, defined insid the human-task module (take a look at the other wiki page to find more about the CDI human task experiment) we need to create a service wrapper which will allows us to expose each method of our interfaces into a service method:
Switchyard imposes some restrictions about the methods that can be exposed, and for that reason our services needs to be wrapped and the arguments to the services needs to be grouped. I've defined a simple POJO called TaskUserRequest to fulfill this requirement.
We can see that the implementation of this interface is a simple facade which redirects the calls to our inject CDI service:
You can see the switchyard configuration file which exposes the service methods:
h1. Sync and Async services calls
The following figure shows how both interactions should work.
h1. Creating Clients
h1. Schedule automatic interactions
Comment by going to Community
Create a new document in jBPM at Community
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jboss-user