cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown property used in expression with the line

tomi87
Champ in-the-making
Champ in-the-making
Hello I need help I get this error:

I marker the line in the test where the error message started.

org.activiti.engine.ActivitiException: Unknown property used in expression
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:55)
   at org.activiti.engine.impl.el.UelExpressionCondition.evaluate(UelExpressionCondition.java:37)
   at org.activiti.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:63)
   at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:80)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:546)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:541)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:80)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:546)


The test:


package org.bpmwithactiviti.Part1ApplicationTest;

import static org.junit.Assert.*;

import java.util.*;

import org.junit.*;
import org.activiti.engine.FormService;
import org.activiti.engine.form.FormProperty;
import org.activiti.engine.history.HistoricDetail;
import org.activiti.engine.history.HistoricFormProperty;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.test.ActivitiRule;
import org.activiti.engine.test.Deployment;

public class TestCreateApplication {

   @Rule
   public ActivitiRule activitiRule = new ActivitiRule("activiti.cfg-mem.xml");

   @Test
   // deploys process with form properties
   @Deployment(resources = { "Part1Application.bpmn20.xml" })
   public void startFormSubmit() {
      ProcessDefinition definition = activitiRule.getRepositoryService()
            .createProcessDefinitionQuery()
            .processDefinitionKey("part1Application").singleResult();
      assertNotNull(definition);

      // call the FormService interface
      FormService formService = activitiRule.getFormService();
      List<FormProperty> formList = formService.getStartFormData(
            definition.getId()).getFormProperties();
      assertEquals(12, formList.size());
      
      Map<String, String> formProperties = new HashMap<String, String>();
      formProperties.put("studentName", "asdsa");
      formProperties.put("emailAddress", "june@localhost");
      formProperties.put("dateFrom", "1234");
      formProperties.put("dateToo", "2345");
      formProperties.put("homeCountry", "asd");
      formProperties.put("homeUniversity", "asfdf");
      formProperties.put("homeDepartment", "asdf");
      formProperties.put("targetUniversity", "asfs");
      formProperties.put("targetDepartment", "sdsd");
      formProperties.put("research", "asdsd");
      formProperties.put("courseEnrollment", "asds");
      formProperties.put("project", "true");
      

[color=#FF0000]//Here the test is stopped[/color]

      
      // submit form properties
      formService.submitStartFormData(definition.getId(), formProperties);
      // view history query for form properties
      List<HistoricDetail> historyVariables = activitiRule
            .getHistoryService().createHistoricDetailQuery()
            .formProperties().list();
      
      assertNotNull(historyVariables);
      assertEquals(12, historyVariables.size());

      HistoricFormProperty formProperty = (HistoricFormProperty) historyVariables.get(0);
      assertEquals("project", formProperty.getPropertyId());
      assertEquals("true", formProperty.getPropertyValue());
      
      formProperty = (HistoricFormProperty) historyVariables.get(1);
      assertEquals("homeUniversity", formProperty.getPropertyId());
      assertEquals("Ostfalia", formProperty.getPropertyValue());

      formProperty = (HistoricFormProperty) historyVariables.get(2);
      assertEquals("targetUniversity", formProperty.getPropertyId());
      assertEquals("Chung Cheng University", formProperty.getPropertyValue());

      formProperty = (HistoricFormProperty) historyVariables.get(3);
      assertEquals("dateToo", formProperty.getPropertyId());
      assertEquals("2345", formProperty.getPropertyValue());
      
   }
}

Part1Application.bpmn20.xml
   <process id="part1Application">
      <startEvent id="start">
         <extensionElements>
            <activiti:formProperty id="studentName" name="Studenten Name"
               required="true" type="string" />
            <activiti:formProperty id="emailAddress" name="Email address"
               required="true" type="string" />
            <activiti:formProperty id="dateFrom" name="Date from"
               required="true" type="long" />
            <activiti:formProperty id="dateToo" name="Date too"
               required="true" type="long" />
            <activiti:formProperty id="homeCountry" name="Home Country"
               required="true" type="string" />
            <activiti:formProperty id="homeUniversity"
               name="Home University" required="true" type="string" />
            <activiti:formProperty id="homeDepartment"
               name="Home Department" required="true" type="string" />
            <activiti:formProperty id="targetUniversity"
               name="Target University" required="true" type="string" />
            <activiti:formProperty id="targetDepartment"
               name="Target Department" required="true" type="string" />
            <activiti:formProperty id="research" name="Research"
               required="true" type="string" />
            <activiti:formProperty id="courseEnrollment"
               name="Course Enrollment" required="true" type="string" />
            <activiti:formProperty id="project" name="With project"
               required="true" type="boolean" />
         </extensionElements>
      </startEvent>
      <sequenceFlow id="flow114" sourceRef="start" targetRef="createRequest"></sequenceFlow>
      <serviceTask id="createRequest" name="Create Request"
         activiti:class="org.process1.CreateStudentApp"></serviceTask>

5 REPLIES 5

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
If a property has no value yet (does not exist as a variable e.g.) you get this error….

mmaker1234
Champ in-the-making
Champ in-the-making
Hello tomi87,

This error is far from the preparation and start of the process instance. Look again at your process definition (not fully provided here) - the problem lays in a gateway:

org.activiti.engine.ActivitiException: Unknown property used in expression
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:55)
   at org.activiti.engine.impl.el.UelExpressionCondition.evaluate(UelExpressionCondition.java:37)
   at org.activiti.engine.impl.bpmn.behavior.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:63)
   at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:80)

tomi87
Champ in-the-making
Champ in-the-making
I just want to test this part:

<process id="part1Application">
      <startEvent id="start">
         <extensionElements>
            <activiti:formProperty id="studentName" name="Studenten Name"
               required="true" type="string" />
            <activiti:formProperty id="emailAddress" name="Email address"
               required="true" type="string" />
            <activiti:formProperty id="dateFrom" name="Date from"
               required="true" type="long" />
            <activiti:formProperty id="dateToo" name="Date too"
               required="true" type="long" />
            <activiti:formProperty id="homeCountry" name="Home Country"
               required="true" type="string" />
            <activiti:formProperty id="homeUniversity"
               name="Home University" required="true" type="string" />
            <activiti:formProperty id="homeDepartment"
               name="Home Department" required="true" type="string" />
            <activiti:formProperty id="targetUniversity"
               name="Target University" required="true" type="string" />
            <activiti:formProperty id="targetDepartment"
               name="Target Department" required="true" type="string" />
            <activiti:formProperty id="research" name="Research"
               required="true" type="string" />
            <activiti:formProperty id="courseEnrollment"
               name="Course Enrollment" required="true" type="string" />
            <activiti:formProperty id="project" name="With project"
               required="true" type="boolean" />
         </extensionElements>
      </startEvent>
      <sequenceFlow id="flow114" sourceRef="start" targetRef="createRequest"></sequenceFlow>
      <serviceTask id="createRequest" name="Create Request"
         activiti:class="org.process1.CreateStudentApp"></serviceTask>

the following code is this:


  <sequenceFlow id="flow129" sourceRef="createRequest"
   targetRef="PG1aa"></sequenceFlow>
  <parallelGateway id="PG1aa" name=""></parallelGateway>
  <sequenceFlow id="flow116" name="" sourceRef="PG1aa"
   targetRef="requestOfEnrollingIsGivenToTheChairman"></sequenceFlow>
  <userTask id="requestOfEnrollingIsGivenToTheChairman" name="request of enrolling is given to the chairman"
   activiti:candidateGroups="DoEE C">
   <documentation>chairman</documentation>
  </userTask>
  <sequenceFlow id="flow117" name=""
   sourceRef="requestOfEnrollingIsGivenToTheChairman" targetRef="sendInformationToTheOoEE"></sequenceFlow>
  <userTask id="sendInformationToTheOoEE"
   name="send information to the office of electrical engineering"
   activiti:candidateGroups="DoEE C">
   <documentation>chairman</documentation>
  </userTask>
  <sequenceFlow id="flow68" sourceRef="sendInformationToTheOoEE"
   targetRef="PG1bb"></sequenceFlow>

  <!– XOR Project or not –>
  <sequenceFlow id="flow115" name="" sourceRef="PG1aa"
   targetRef="XORAProjectOrNot"></sequenceFlow>
  <exclusiveGateway id="XORAProjectOrNot" name="" />
  <sequenceFlow id="flow63" name="Project" sourceRef="XORAProjectOrNot"
   targetRef="sendInformationsFromTheProfessors">
   <conditionExpression xsi:type="tFormalExpression">${StudentAppInfo.project == true}</conditionExpression>
  </sequenceFlow>
  <sequenceFlow id="flow69" name="No Project" sourceRef="XORAProjectOrNot"
   targetRef="XORBProjectOrNot">
   <conditionExpression xsi:type="tFormalExpression">${StudentAppInfo.project == false}</conditionExpression>
  </sequenceFlow>

  <!– Send a email with a list of advisor to the student –>
  <userTask id="sendInformationsFromTheProfessors" name="send informations from the professors"
   activiti:candidateGroups="DoEE O">
   <extensionElements>
   <activiti:formProperty id="advisorList" name="Advisors"/>
   </extensionElements>
    </userTask>
  <sequenceFlow id="flow1" name=""
   sourceRef="sendInformationsFromTheProfessors" targetRef="searchAProfessorAsAdvisor"></sequenceFlow>

  <userTask id="searchAProfessorAsAdvisor" name="search a professor as advisor"
   activiti:candidateGroups="student">
   <documentation>Student</documentation>
   <extensionElements>
    <!– displays the customer name and set field to read-only –>
    <activiti:formProperty id="advisorList" name="List of advisors"
     expression="${advisorList}" writable="false" />
    <activiti:formProperty id="advisorName" name="Advisor"/>
   </extensionElements> 
  </userTask>
  <sequenceFlow id="flow2" name="" sourceRef="searchAProfessorAsAdvisor"
   targetRef="askTheProfessorIfHeWouldBeAdvisor"></sequenceFlow>
  <userTask id="askTheProfessorIfHeWouldBeAdvisor" name="ask the professor if he would be advisor"
   activiti:candidateGroups="student">
   <documentation>Student</documentation>
  </userTask>
  <sequenceFlow id="flow102" name=""
   sourceRef="askTheProfessorIfHeWouldBeAdvisor" targetRef="decideToBeTheAdvisorForTheStudent"></sequenceFlow>
  <userTask id="decideToBeTheAdvisorForTheStudent" name="decide to be the advisor for the student"
   activiti:candidateGroups="AdvisorGroup">
   <documentation>advisor</documentation>
 
   <extensionElements>
    <!– displays the customer name and set field to read-only –>
    <activiti:formProperty id="studentName" name="Student name"
     expression="${StudentAppInfo.studentName}" writable="false" />

    <activiti:formProperty id="homeCountry" name="Home Country"
     expression="StudentAppInfo.homeCountry" writable="false" />

    <activiti:formProperty id="research" name="Research"
     expression="StudentAppInfo.research" writable="false" />

    <activiti:formProperty id="dateFrom" name="Date from"
     expression="StudentAppInfo.dateFrom" writable="false" />

    <activiti:formProperty id="dateToo" name="Date too"
     expression="StudentAppInfo.dateToo" writable="false" />

    <activiti:formProperty id="homeUniversity"
     name="Home University" expression="StudentAppInfo.homeUniversity"
     writable="false" />

    <activiti:formProperty id="homeDepartment"
     name="Home Department" expression="StudentAppInfo.homeDepartment"
     writable="false" />

    <!– Defines new requestApproved process variable –>
    <activiti:formProperty id="requestAccepted"
     name="Do you accepted this request?" required="true" type="enum">
     <activiti:value id="true" name="Yes" />
     <activiti:value id="false" name="No" />
    </activiti:formProperty>
    <activiti:formProperty id="comments" name="Comments"/>
   </extensionElements>
  </userTask>
  <sequenceFlow id="flow103" name=""
   sourceRef="decideToBeTheAdvisorForTheStudent" targetRef="XORAdvisorOrNot"></sequenceFlow>
  <exclusiveGateway id="XORAdvisorOrNot" name="" />
  <sequenceFlow id="flow104" name="request is accepted"
   sourceRef="XORAdvisorOrNot" targetRef="PG1a">
   <conditionExpression xsi:type="tFormalExpression">${requestAccepted
    == true}</conditionExpression>
  </sequenceFlow>
  <sequenceFlow id="flow105" name="request is refused"
   sourceRef="XORAdvisorOrNot" targetRef="searchAProfessorAsAdvisor">
   <conditionExpression xsi:type="tFormalExpression">${requestAccepted
    == false}</conditionExpression>
  </sequenceFlow>

  <parallelGateway id="PG1a" name=""></parallelGateway>
  <sequenceFlow id="flow61" name="" sourceRef="PG1a"
   targetRef="sendThisInfoToTheChairman"></sequenceFlow>
  <sequenceFlow id="flow106" name="" sourceRef="PG1a"
   targetRef="sendInfoToTheOoEE"></sequenceFlow>
  <userTask id="sendThisInfoToTheChairman" name="send this information to the chairman"
   activiti:candidateGroups="AdvisorGroup">
   <documentation>advisor</documentation>
  </userTask>
  <sequenceFlow id="flow7" name="" sourceRef="sendThisInfoToTheChairman"
   targetRef="PG1b"></sequenceFlow>
  <userTask id="sendInfoToTheOoEE" name="send info to the Office of EE" activiti:candidateGroups="AdvisorGroup">
      <documentation>advisor</documentation>
   <documentation>chairman</documentation>
  </userTask>
  <sequenceFlow id="flow107" name="" sourceRef="sendInfoToTheOoEE"
   targetRef="PG1b"></sequenceFlow>
  <parallelGateway id="PG1b" name=""></parallelGateway>
  <sequenceFlow id="flow124" name="" sourceRef="PG1b"
   targetRef="XORBProjectOrNot"></sequenceFlow>
  
  <exclusiveGateway id="XORBProjectOrNot" name=""></exclusiveGateway>
  <sequenceFlow id="flow125" name="" sourceRef="XORBProjectOrNot"
   targetRef="PG1bb"></sequenceFlow>
  <parallelGateway id="PG1bb" name=""></parallelGateway>
  <sequenceFlow id="flow126" name="" sourceRef="PG1bb"
   targetRef="certificateTheEnrollingOfTheUniversity"></sequenceFlow>

  <userTask id="certificateTheEnrollingOfTheUniversity" name="certificate the enrolling of the university"
   activiti:candidateGroups="DoEE C">
   <documentation>chairman</documentation>
  </userTask>
   <sequenceFlow id="flow71" sourceRef="certificateTheEnrollingOfTheUniversity" targetRef="studentGetTheCertificate"></sequenceFlow>
   
    <userTask id="studentGetTheCertificate" name="student get the certificate" activiti:candidateGroups="student">
      <documentation>Student</documentation>
     
    </userTask>
     <sequenceFlow id="flow130" sourceRef="studentGetTheCertificate" targetRef= "end"></sequenceFlow>
  <endEvent id="end" />
</process>
</definitions>


What I should change in my Test that it tests just the firstpart: "createRequest" ?

Or wrote I something wrong in my code for the Exclusive gateway ? maybe the variable…?

tomi87
Champ in-the-making
Champ in-the-making
Can anyone help me please ?

frederikherema1
Star Contributor
Star Contributor
Look at the CAUSE of the activiti-exception in the stack trace, there should be a JUEL-exception telling you what property is missing exactly. Make sure that every variable you use in your process, is actually present at the time you need it.

i'm suspecting this expression could cause it:


<sequenceFlow id="flow69" name="No Project" sourceRef="XORAProjectOrNot"
         targetRef="XORBProjectOrNot">
         <conditionExpression xsi:type="tFormalExpression">${StudentAppInfo.project == false}</conditionExpression>
      </sequenceFlow>