Unable to get process variable in XOR expression - NullPointerException

1,190 views
Skip to first unread message

onkar hingne

unread,
Jul 7, 2016, 4:48:51 AM7/7/16
to jBPM Usage
I am trying to access a process variable in the expressions that I have set on the 2 branches of a XOR split but I am getting a nullpointerexception 

Caused by: java.lang.RuntimeException: Exception when trying to evaluate constraint  in split 
at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:93) [jbpm-flow-6.4.0.Final.jar:6.4.0.Final]
at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:63) [jbpm-flow-6.4.0.Final.jar:6.4.0.Final]
... 139 more
Caused by: java.lang.RuntimeException: unable to execute ReturnValueEvaluator: 
at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:131) [jbpm-flow-6.4.0.Final.jar:6.4.0.Final]
at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:86) [jbpm-flow-6.4.0.Final.jar:6.4.0.Final]
... 140 more
Caused by: java.lang.NullPointerException
at org.jbpm.Process_org$u46$jbpm$u46$iEvaluation1710316301.returnValueEvaluator0(Process_org$u46$jbpm$u46$iEvaluation1710316301.java:10)
at org.jbpm.Process_org$u46$jbpm$u46$iEvaluation1710316301ReturnValueEvaluator0Invoker.evaluate(Process_org$u46$jbpm$u46$iEvaluation1710316301ReturnValueEvaluator0Invoker.java:15)
at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:129) [jbpm-flow-6.4.0.Final.jar:6.4.0.Final]
... 141 more

Maciej Swiderski

unread,
Jul 7, 2016, 4:51:18 AM7/7/16
to onkar hingne, jBPM Usage
that indicates the variable is not set. How did you set it?

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/2f8db0fa-745f-4ce7-a7f6-0cab65a86f81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

onkar hingne

unread,
Jul 7, 2016, 5:19:15 AM7/7/16
to jBPM Usage, onkar....@gmail.com
I have declared a process variable evaluationData on the process level which is a defined Data object. I have mapped that input to all the task so when I fill the forms for the task the process variable should get updated. 

The data I have updated in the start of the process is seen in the next tasks
prcessvariable.jpg
business_rule_assignemtns.jpg

onkar hingne

unread,
Jul 7, 2016, 5:24:40 AM7/7/16
to jBPM Usage, onkar....@gmail.com
pfa the process snapshot, when i start the process I set values and if one first human task if i update the values then I am able to see the updated values on the second human task
process.png

Maciej Swiderski

unread,
Jul 7, 2016, 6:13:28 AM7/7/16
to onkar hingne, jBPM Usage
is this screenshot of data assignment for business rule task? If so, the problem is with the name of data output - to fetch the updated object (after rule evaluation) it must be named exactly as the datainput as this is the correlation used. If there is no match it will return null and reset your process variable.

Maciej

For more options, visit https://groups.google.com/d/optout.
<prcessvariable.jpg><business_rule_assignemtns.jpg>

onkar hingne

unread,
Jul 7, 2016, 6:40:41 AM7/7/16
to jBPM Usage, onkar....@gmail.com
OK. Let me try that out. Is this applicable only for the business rule task or for all types of tasks.

Also I am putting print statements (sysout) on each task at the start but they dont get printed in the server log. Is it possible to add prints in the start / exit of each task ? 
is server log the wring place to look for such print statements?

Maciej Swiderski

unread,
Jul 7, 2016, 7:07:36 AM7/7/16
to onkar hingne, jBPM Usage
it’s for business rule task only 

sysouts from on-entry/exit should work and they should be printed out in server.log. You might want to look at processEventListeners if the printout are generic so they can apply then to all nodes without explicit change to the process

Maciej

onkar hingne

unread,
Jul 7, 2016, 9:32:32 AM7/7/16
to jBPM Usage, onkar....@gmail.com
Yes it worked when i matched the variable names. Thanks a lot!!

onkar hingne

unread,
Jul 8, 2016, 3:28:42 AM7/8/16
to jBPM Usage, onkar....@gmail.com
Hi Maciej,

When I try to start the process i defined yesterday from remote client (rest) I am getting a jaxb exception . 
javax.xml.bind.JAXBException: "workflowpoc.evaluation.EvaluationData" doesnt contain ObjectFactory.class or jaxb.index 

I have created a EvaluationData POJO in my remote client within the same package and annotated the pojo fields using JAXB annotations. I use the below way to serialize my data and send it to the process. I use the RemoteRuntimeEngineFactory.newRestBuilder to get the engine and session. 

try {
params.put("evaluationData",JaxbSerializationProvider.serialize(JAXBContext.newInstance( "workflowpoc.evaluation.EvaluationData" ) , true, data));
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ProcessInstance processInstance = 
ksession.startProcess("Evaluation.iEvaluation", params);

I was able to pass pure string params and start the process but i am not able to pass objects. If this is not intended to work with objects is there a way to take string params and map it to the data object. 

Regards
Onkar 

onkar hingne

unread,
Jul 8, 2016, 3:53:30 AM7/8/16
to jBPM Usage, onkar....@gmail.com
I found the issue I was missing ".class" while creating JAXBContext.newInstance after fixing that the process got created and i could see that the evaluation data contains an XML when I login to jbpm console but the form data is seen null. The evaluation data object XML is not mapping to the form field. 

PFA the snapshots of the process instance data objects and the form that the first human task actor sees (empty)
DataObj_AsXML.png
empty_formdata.png
Reply all
Reply to author
Forward
0 new messages