AnsweredAssumed Answered

Unknown property used in expression with the line

Question asked by tomi87 on Jan 7, 2013
Latest reply on Jan 10, 2013 by frederikheremans1
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>

Outcomes