AnsweredAssumed Answered

calling getter inside method Returns java.lang.NullPointerException with Activiti Engine

Question asked by ilyass_act on May 3, 2017
Latest reply on May 5, 2017 by ilyass_act

i'm tryin to implement my own java logic using SPRING + JSF with activiti , this my BPMN file :

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"

targetNamespace="http://www.bpmnwithactiviti.org"
xmlns:activiti="http://activiti.org/bpmn">
<process id="my-process" name="my-process">
<startEvent id="startEvent" name="Start" activiti:formKey="taskForm_newOrder.jsf" />
<sequenceFlow id="toValidateTask" sourceRef="startEvent" targetRef="validateTask"/>

<serviceTask id="validateTask" activiti:expression="#{operationController.sayHello()}" >
<extensionElements>
<activiti:field name="input" expression="${adminModele.operationLabel}" />
</extensionElements>
</serviceTask>

<sequenceFlow id="toCompletedOrderTask" sourceRef="validateTask" targetRef="completeOrderTask"/>
<userTask id="completeOrderTask" name="Complete order" activiti:assignee="${adminModele.operationLabel}" activiti:formKey="taskForm_completeOrder.jsf">
<documentation>Completing order for book with isbn : ${adminModele.operationLabel} </documentation>
</userTask>
<sequenceFlow id="toApproveTask" sourceRef="completeOrderTask" targetRef="approveTask"/>
<serviceTask id="approveTask" activiti:expression="#{bookOrder.validates()}" />
<sequenceFlow id="toEndEvent" sourceRef="approveTask" targetRef="endEvent"/>
<endEvent id="endEvent" name="End"/>
</process>
</definitions>

the sayHello() :

public void sayHello(){

System.out.println("SayHello ................."+bookOrder.getIsbn());

}

 

 when i do a simple call to sayHello ()  it displays what i want but when the ServiceTask calls sayHello i get  JavaNullPointerException , means my bookOrder object is null .

Any ideas how to deal with this problem

Outcomes