[jboss-user] [jBPM] - Unclear on how to get a Process param into my WorkItem

olddave do-not-reply at jboss.com
Wed Aug 10 11:54:29 EDT 2011


olddave [http://community.jboss.org/people/olddave] created the discussion

"Unclear on how to get a Process param into my WorkItem"

To view the discussion, visit: http://community.jboss.org/message/620414#620414

--------------------------------------------------------------
Hi,

I am defining my workflows using the BPMN2 Eclipse tool. When I run my WorkItem I need to get access to a parameter defined in the Process. I use this, which is not good because many Process may be running witht this same parameter in thei Stateful session.

[code]

| 
 | 
 | AClass myContext = null; | 
 |
| 
 | 
 | Iterator<ProcessInstance> it = ksession.getProcessInstances().iterator(); | 
 |
| 
 | 
 | while(it.hasNext()) { | 
 |
| 
 | 
 | 
 | ProcessInstance procInst =it.next(); | 
 |
| 
 | 
 | 
 | Map<String,Object> contxt =  procInst.getProcess().getMetaData(); | 
 |
| 
 | 
 | 
 | if(contxt.containsValue("myContext")) { | 
 |
| 
 | 
 | 
 | 
 | myContext = (AClass) contxt.get("myContext"); |
| 
 | 
 | 
 | } | 
 |
| 
 | 
 | } | 
 |
| 
 | 
 | if(myContext != null) | 
 |
| 
 | 
 | 
 | service.run(aGrp, myContext); | 
 |
| 
 | 
 | manager.completeWorkItem(workItem.getId(), null); | 
 |

[/code]

salaboy pointed to his general examples for a similar question and I looked in all of them and could not see where theh recommended way of accessing a Process parameter is shown.

Thx.

David
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/620414#620414]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

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


More information about the jboss-user mailing list