JBoss Community

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

created by Bruce Cui in jBPM - View the full discussion

Here is the thing. I'm trying to test a self-defined service task. I have referred to the Chapter 13 in the user guide, and also the "JBPM5 Example - Human Task Forms with Variables - WorkItems" example. They worked fine.

 

But I met problem when I tried to add an integer parameter in the task. Here are the things I have done:

1. Defined a process with 4 String variables, and 1 Integer varible. Say aStr, bStr, cStr, dStr, and aInt.

2. Defined a process form which is taking 4 String params. And aStr takes an integer value.

3. Put a script task right after the start point. Parse aStr to aInt.

4. Create a MyWorkDefinitions.wid file with the definition of my service task. 3 StringDataType, and 1 IntegerDataType parameters. Packs imported.

5. Create a drools.rulebase.conf with MyWorkDefinitions.wid and WorkDefinitions.conf defined. (Here in the user guide there is a mistake).

 

Until here, all things went fine. I can see the service task in a new editor window, and can see the parameters when I put one in the canvas. But the problem happened when I assign the variables to the parameters for the Integer one.

 

I used format #{bStr} for the three String ones, they got accepted. But when I assigned #{aInt} to the Integer param, I got an error window.

 

Here is a full message in the error log: (mxtInt is the actual variable name in my local file)

http://community.jboss.org/servlet/JiveServlet/downloadImage/2-611945-16583/450-496/2011-06-25_150959.jpg

 

I'm new to both JBPM or Drools. I'm not sure whether I'm using this right. Please help me out here.

 

Also I would like to know if there are any examples with output back to the process.

 

Thanks in advace.

Reply to this message by going to Community

Start a new discussion in jBPM at Community