Search in sources :

Example 16 with Expression

use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.

the class HumanTaskPlanItemHandlerTest method testTaskDefinitionPeformerExpression.

@Test
public void testTaskDefinitionPeformerExpression() {
    // given
    CaseRole role = createElement(caseDefinition, "aRole", CaseRole.class);
    role.setName("aPerformerRole");
    humanTask.setPerformer(role);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
    TaskDefinition taskDefinition = behavior.getTaskDefinition();
    Expression assigneeExpression = taskDefinition.getAssigneeExpression();
    assertNotNull(assigneeExpression);
    assertEquals("aPerformerRole", assigneeExpression.getExpressionText());
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) Expression(org.camunda.bpm.engine.delegate.Expression) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) CaseRole(org.camunda.bpm.model.cmmn.instance.CaseRole) HumanTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 17 with Expression

use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.

the class HumanTaskPlanItemHandlerTest method testTaskDefinitionAssigneeExpression.

@Test
public void testTaskDefinitionAssigneeExpression() {
    // given
    String aPriority = "aPriority";
    humanTask.setCamundaPriority(aPriority);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
    TaskDefinition taskDefinition = behavior.getTaskDefinition();
    Expression priorityExpression = taskDefinition.getPriorityExpression();
    assertNotNull(priorityExpression);
    assertEquals(aPriority, priorityExpression.getExpressionText());
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) Expression(org.camunda.bpm.engine.delegate.Expression) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) HumanTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 18 with Expression

use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.

the class HumanTaskPlanItemHandlerTest method testTaskDefinitionPriorityExpression.

@Test
public void testTaskDefinitionPriorityExpression() {
    // given
    String aPriority = "aPriority";
    humanTask.setCamundaPriority(aPriority);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
    TaskDefinition taskDefinition = behavior.getTaskDefinition();
    Expression priorityExpression = taskDefinition.getPriorityExpression();
    assertNotNull(priorityExpression);
    assertEquals(aPriority, priorityExpression.getExpressionText());
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) Expression(org.camunda.bpm.engine.delegate.Expression) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) HumanTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 19 with Expression

use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.

the class HumanTaskPlanItemHandlerTest method testTaskDefinitionFollowUpDateExpression.

@Test
public void testTaskDefinitionFollowUpDateExpression() {
    // given
    String aFollowUpDate = "aFollowDate";
    humanTask.setCamundaFollowUpDate(aFollowUpDate);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
    TaskDefinition taskDefinition = behavior.getTaskDefinition();
    Expression followUpDateExpression = taskDefinition.getFollowUpDateExpression();
    assertNotNull(followUpDateExpression);
    assertEquals(aFollowUpDate, followUpDateExpression.getExpressionText());
}
Also used : TaskDefinition(org.camunda.bpm.engine.impl.task.TaskDefinition) Expression(org.camunda.bpm.engine.delegate.Expression) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) HumanTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 20 with Expression

use of org.camunda.bpm.engine.delegate.Expression in project camunda-bpm-platform by camunda.

the class FieldSpec method verify.

public void verify(FieldDeclaration field) {
    assertEquals(fieldName, field.getName());
    Object fieldValue = field.getValue();
    assertNotNull(fieldValue);
    assertTrue(fieldValue instanceof Expression);
    Expression expressionValue = (Expression) fieldValue;
    assertEquals(getExpectedExpression(), expressionValue.getExpressionText());
}
Also used : Expression(org.camunda.bpm.engine.delegate.Expression) CamundaExpression(org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression)

Aggregations

Expression (org.camunda.bpm.engine.delegate.Expression)62 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)18 Test (org.junit.Test)15 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)14 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)14 HumanTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)12 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)12 HumanTask (org.camunda.bpm.model.cmmn.instance.HumanTask)8 ArrayList (java.util.ArrayList)4 Date (java.util.Date)4 CmmnIfPartDeclaration (org.camunda.bpm.engine.impl.cmmn.model.CmmnIfPartDeclaration)4 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)4 CamundaField (org.camunda.bpm.model.cmmn.instance.camunda.CamundaField)4 FieldDeclaration (org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration)3 CaseControlRuleImpl (org.camunda.bpm.engine.impl.cmmn.behavior.CaseControlRuleImpl)3 CmmnSentryDeclaration (org.camunda.bpm.engine.impl.cmmn.model.CmmnSentryDeclaration)3 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)3 CamundaExpression (org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression)3 CamundaString (org.camunda.bpm.model.cmmn.instance.camunda.CamundaString)3 Collection (java.util.Collection)2