Mauricio Salatino [
https://community.jboss.org/people/salaboy21] created the discussion
"Re: Passing work item results to process variables"
To view the discussion, visit:
https://community.jboss.org/message/815842#815842
--------------------------------------------------------------
Hi David,
Did you check the Web Process Designer? That's definitely more updated than the
Eclipse Plugin.
As you mention copying variables from the work item scope to the process scope and vice
versa is something vital. You need to understand that for doing that you need to have the
correct mappings in the process file and then make sure that your work item is filling the
variables that the process is expecting to do the copy.
So for example let's say that you have a Process Variable called: String
Customer_Name;
At process level you should have the variable defined. In your work item you will need to
define the Customer_Name variable as an input variable if you want to display or use the
content of the variable (maybe another activity change its value) and as an output
variable if you want to override the process variable. These mappings will be something
like this:
Customer_Name -> this is the process variable
Now inside the WorkItem
dataInputs:
in_Customer_Name -> This represents the internal Work Item variable, it's not yet
mapped to the process variable
dataOutputs:
out_Customer_Name -> This represents the internal Work Item variable that will be
copied back to the process, it's not yet mapped to the process variable
Assignments:
Customer_Name ---(Mapped to)--> in_Customer_Name -> This will copy the value of
the process variable to the work Item in_Customer_Name when the process reach the work
item node
out_Customer_Name ---(Mapped to)--> Customer_Name -> This will tell the process to
override the process variable called Customer_Name with the value of the internal work
item variable
called
out_Customer_name.
This mechanism is being defined by the BPMN2 language, and for that reason you need to
have that in your xml file.
Notice that your WorkItemHandler will only work with in_Customer_name and
out_Customer_Name, that means that your Map<String, Object> params will need to have
those keys or at least the ones defined in the dataOutputs in order to override the
Process variables when you complete the WorkItemHandler.
Hope this helps
Cheers
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/815842#815842]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]