Paul Mueller [
http://community.jboss.org/people/PaulTK] created the discussion
"Beginner Question: How to pass process variables to a Java Task"
To view the discussion, visit:
http://community.jboss.org/message/538718#538718
--------------------------------------------------------------
Hi!
I am new to jBPM, and i currently do not understand how to pass process variables into a
Java Task.
To start the java task i have this code fragment:
<java name="MyMethod" method="testMethod"
var="result">
<arg>
<string value="#{test}"/>
</arg>
</java>
The java method:
public String testMethod( String testIn )
{
System.out.println(testIn);
return testIn+"_result";
}
To start the process i have this:
Map<String,Object> variables = new HashMap<String,Object>();
variables.put("test", "a test text");
pi = executionService.startProcessInstanceByKey("MyProcess", variables );
As a result i got "#{test}" and not "a test text". So what i am doing
wrong?
And what is the best practice to pass process variables to a java task?
Thanks for help!
Paul
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/538718#538718]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]