AnsweredAssumed Answered

Unknown property used in expression: #{bookOrder.validates()}

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

Hi everyone i tried CDI with Activiti but i keep getting this error :

Unknown property used in expression: #{bookOrder.validates()}

Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'bookOrder'

My BookOrder class : 

@Named("bookOrder")
public class BookOrder {

private static final long serialVersionUID = 1L;

private String isbn;
private boolean approved;

public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public boolean isApproved() {
return approved;
}
public void setApproved(boolean approved) {
this.approved = approved;
}


public void validates() {
System.out.println("Testing the CDI ...");
}


}

and the BPMN file :

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="my-process" name="bookorder">
<startEvent id="startEvent" name="Start" activiti:formKey="taskForm_newOrder.jsf" />
<sequenceFlow id="toValidateTask" sourceRef="startEvent" targetRef="validateTask"/>
<serviceTask id="validateTask" activiti:expression="#{bookOrder.validates()}" />
<sequenceFlow id="toCompletedOrderTask" sourceRef="validateTask" targetRef="completeOrderTask"/>
<userTask id="completeOrderTask" name="Complete order" activiti:assignee="kermit" activiti:formKey="taskForm_completeOrder.jsf">
<documentation>Completing order for book with isbn </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>

 

Any ideas what i'm doing Wrong here ??

Outcomes