JBoss Community

Re: How can a Service Task take integer variable via additional parameters?

created by Kris Verlaenen in jBPM - View the full discussion

Hi,

 

#{expression} only works for String parameters (as the result it produces is a String).  To map any other object to a Task parameter, you should use parameter mapping.  Parameter mapping allows you to copy the value of a process variable to the Task parameter.  For example, if you want to copy an Integer as a service parameter, define a parameter mapping that copies the value from a process variable to that service parameter.  You can use an on-entry/on-exit action on your service task (or a normal script task before the service task) to set the value of the Integer (in this case something like kcontext.setVariable("myIntVariable", new Integer(mxInt));

 

The documentation on service input / output mapping has recently been extended, so it might be useful to reread the core engine: basics chapter and the human tasks chapter.

 

Kris

Reply to this message by going to Community

Start a new discussion in jBPM at Community