[jboss-user] [jBPM] - Re: JBPM and Webservice call with callback - please advise

Maciej Swiderski do-not-reply at jboss.com
Thu Oct 18 07:27:23 EDT 2012

Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM and Webservice call with callback - please advise"

To view the discussion, visit: https://community.jboss.org/message/766648#766648

> mvermand wrote:
> Challenge 1: Creating a callback to complete the Task-A:
> I found something similar (I think) in an example called "PersistentEmergencyServiceProcess", though
> I'm not sure it is a good staring point since:
> 1) this handles about human tasks
> 2) it has an ActiveWorkItemService.java class which states:
>  * This class doesn't support ksession crashes. The ksession passed to its 
>  * constructor must leave through all the process execution.
> ==> what if the server get's restarted within the life-span of 1 hour or 1 day?
It can be modeled in several ways, to name few:
1. use custom work item handler that sends web service requests but does not complete work item and provide custom endpoint that will receive response and complete appropriate work item
2. use service task to invoke web service operation in fire and forget mode then use event based gateway to split the flow into two branches one with intermediate catch signal event and the other with timer - signal event waits for response from your service - of course you need to have an endpoint that will receive response and signals the process

Personally prefer option 2 as it gives more visibility on the process what happens, just a note that event based gateways could have some issues but it is on todo list so will get better if required.

> mvermand wrote:
> Challenge 2: Creating a duedate/timeout on the Task-A:
> In JBPM4.4 it is quite easy to set a timer (duedate) on a task.
> How can this be done in JBPM5?
> I do not see such property on a Task in the JBPM Editor.
For this you should use boundary timer events that is attached to a task. It has capability to cancel task that is attached to and continue with alternative path.

> mvermand wrote:
> Challenge 3: How to call an external webservice:
> Are there any available helper-classes to easely achieve this?
> Or should I just generate POJO from a WSDL and call this code from a bean?
Take a look  http://mswiderski.blogspot.com/2012/07/service-task-with-web-service.html here, it describes runtime engine support for web service invocation.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121018/a92f00c5/attachment.html 

More information about the jboss-user mailing list