JBoss Community

JBPM and Webservice call with callback - please advise

created by mvermand in jBPM - View the full discussion

Hi,

 

I'm quite new to JBPM5, though have worked quite a lot with JBPM4.4.

 

We are investigating if we can switch to JBPM5.

I need to create a Task in a bpmn flow that sends a message to an external webservice.

Lets call this Task-A.

Moreover, the external party must respond (async) within a definable time (for example 1 hour or 1 day...)

Only if the external party responds within this time period,Task-A can be completed and the next task can be started.

Else a different (error-reporting/fallback) task should be started.

If no response arrived in time, Task-A should be marked as terminated/obsolete(?) so in case a response of the external party arrives afterwards, this has no effect anymore.

 

Can you give me any ideas in how to accomplish this?

 

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?

 

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.

 

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?

 

 

Any advice will be greatly appreciated!

 

Michiel

Reply to this message by going to Community

Start a new discussion in jBPM at Community