-
1. Re: Web Service client in Jbpm 5.4
swiderski.maciej Jun 28, 2013 9:18 AM (in response to aarellano)If you already have the service implemented as web service then it makes sense to use the service task and just all it from whitin the process. If you consider implementing the web service from scratch maybe you can consider using domain specific service in jbpm that allows you to encapsulate given logic in process task. See details here
HTH
-
2. Re: Web Service client in Jbpm 5.4
aarellano Jun 28, 2013 10:49 AM (in response to swiderski.maciej)Hi Maciej,
Could you explain me a little bit more the first option? ("use the service task and just all it from whitin the proces")
Because I need that my jBPM process calls automatically a WebService that is published in my WebApplication. The problem that I see is how to modify the "Service Task" using the Guvnor Designer in order to define a WSClient or communicate with external systems.
Thanks!
-
3. Re: Web Service client in Jbpm 5.4
swiderski.maciej Jun 28, 2013 12:03 PM (in response to aarellano)it should state:
".... use the service task and just call if from within the process..."
anyway in 5.4 I am afraid there is not web service task support in web designer so that mean you need to either use newer version or do the changes manually in bpmn2 file (most likely not appealing task). You could try to use this designer branch to build as it should be compatible with 5.4 but with new features. That branch seems to have support for Web Service Service task
HTH
-
4. Re: Web Service client in Jbpm 5.4
aarellano Jun 28, 2013 12:23 PM (in response to swiderski.maciej)Thanks Maciej,
However I´m reading two options that could work for me and maybe you could provide some information:
1.- Create a new Work Item Definition in Guvnor with the Designer and create a Work Item Handler on my WebApp. And when I start my application link my handler with the item definition. I don´t know if I understand all the implementation details.
2.- To use the project: jBPM5-Executor-Service but I don´t know if it wich solution provides me a clean solution.
Thanks!
-
5. Re: Web Service client in Jbpm 5.4
aarellano Jul 4, 2013 2:59 AM (in response to aarellano)Hi all,
Finally I found a way to solve my problem with my architecture.
Steps:
- I create in GUVNOR a new WorkItemDefinition in the package where my process is defined. Then the "Service Tasks" Tab is available in the Process Designer. (I could not set an image to the Service Task due some error to find it)
- I set in the designer the Service Task where I need it.
- In my Web Application I create a class that handles the Service Task and should implements org.drools.runtime.process.WorkItemHandler
- In the new class define the action in the executeWorkItem method. To complete the task from here this code is needed:
public void executeWorkItem(WorkItem workItem, WorkItemManager workManager) {
System.out.println("+++++++++++++ in the SubviewRevisionValidatorHandler ++++++++++++++++");
You can define a WebService client as in my case or the logic that you need
workManager.completeWorkItem(workItem.getId(), param);
}
- In my Web Application (that start the process) I set this lines before start a process where the first param is the name that you provide in Guvnor to the service and the second param is the new class in you App:
ksession.getWorkItemManager().registerWorkItemHandler("ServiceTaskName", new ServiceTaskItemHandler());