JBoss Community

Re: JBPM 5.1 Final Release with jboss-5.1.0.GA - Human Task taskId

created by William Timpany in jBPM - View the full discussion

I am not sure if this will be of use, but we do a similar thing. 

 

We create a relation between a "Human Task" and our own Application Model.  Since the Task ID does not exist before the Task is persisted, we pass our own Model Object ID to the Task.  I did not want to extend the Task Object to hold our FK, so I decided to use the "Priority" field in the Task to store the reference (this may have to change in the future if we need to use priorities).     The reason for not extending the Task, was that I wanted to use the vanilla JBPM code.

 

We have a Script Task before the Human Task to inject our Model FK ID into the context, then use this context variable in the Task.

 

Script Task: not the real code but it gives the idea.

  // -- getBeanId returns Integer

  kcontext.setVariable("myExternalModelID", MyExternalModelBean.getBeanId() );

 

Human Task:

  Priority property: #{myExternalModelID}

 

Doing it this way alows us to then Join our Model Bean to the JBPM Task:  MyExternalModelBean.beanId == Task.priority

Reply to this message by going to Community

Start a new discussion in jBPM at Community