-
1. Re: working with variables in custom work items
jsvitak Jul 9, 2012 9:01 AM (in response to xealous)Hello,
you haven't specified when you want to provide variables into the process. But you have several options:
1.) you can pass your variables when starting your business process instances
2.) you can use global variables of knowledge session
3.) you can pass data through signalling an event
I recommend you reading the docs:
http://docs.jboss.org/jbpm/v5.3/userguide/ch.core-basics.html#sec.data
This link describes how to map your data into the human tasks:
http://docs.jboss.org/jbpm/v5.3/userguide/ch.human-tasks.html#d0e5071
-
2. Re: working with variables in custom work items
xealous Jul 9, 2012 9:52 AM (in response to jsvitak)Thank you for your quick response.
But my question is not this. I'm using a custom work item handler. this is how i get a variable's value in my custom java code:
myProjectName = (String) workItem.getParameter("projectName");
now i wanna do something like this:
workItem.setParameter("parameter", value);
but this does not exist as far as i know. Is there any way i can achieve this?
-
3. Re: working with variables in custom work items
jsvitak Jul 9, 2012 10:01 AM (in response to xealous)To retrieve a result from a user defined service task you have to add a new result parameter into your work item definition file.
Then you can pass a result value from your work item handler into your business process using this code:
Map workItemResults = new HashMap(); workItemResults.put("parameter", value); workItemManager.completeWorkItem(workItem.getId(), workItemResults);