2

I need some help with jbpm and the modeling using the kie-workbench. My scenario:

A user is presented a list of potential service-providers. He can now select multiple of these and specify a date, which acts as deadline for the providers to respond to that request (a pending request shall be interpreted as "the provider declined the request" when the timeout hits). After all replies are available (either by response or by timeout) the process shall continue an the replies are presented to the user.

I have to model this behavior using jbpm and would like to know the best approach to do so.

My first idea was to simply use a "multiple instance subprocess" for that purpose something like this

Sadly that is not possible, since these are executed sequentially and therefore it might not be possible for a service-provider to respond, since another one already timed out. Also, since the number of instances to be executed are determined at runtime, a simple parallel gateway would neither do the job.

Any suggestions on how to model this scenario properly using jbpm?

EDIT:

I don't know, if the following is considered "dirty", but this is my current idea (not fully implemented yet):

Add a process-variable "subProcId" which is referenced by the subprocess-node as "Called Element". Right before this node, I call a Custom Service Task, which will do the following:

  • Use RuleFlowProcessFactory to create a process-definition based on current runtime data
  • Build the process and upload it to the Execution-server using its REST-API
  • Set the "subProcId" to contain the id of the created process

Using this approach, I can define a Subprocess containing a parallel gateway with the exact amount of outgoing connections needed.

Any ideas if this is a good idea and could actually work?

Muto
  • 140
  • 1
  • 10

0 Answers0