use of org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior 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());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior 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());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior 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());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior 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());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class HumanTaskPlanItemHandlerTest method testDeleteTaskListenerByDelegateExpression.
@Test
public void testDeleteTaskListenerByDelegateExpression() {
// given:
ExtensionElements extensionElements = addExtensionElements(humanTask);
CamundaTaskListener taskListener = createElement(extensionElements, null, CamundaTaskListener.class);
String delegateExpression = "${myDelegateExpression}";
String event = TaskListener.EVENTNAME_DELETE;
taskListener.setCamundaEvent(event);
taskListener.setCamundaDelegateExpression(delegateExpression);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
assertEquals(0, activity.getListeners().size());
HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
TaskDefinition taskDefinition = behavior.getTaskDefinition();
assertNotNull(taskDefinition);
assertEquals(1, taskDefinition.getTaskListeners().size());
List<TaskListener> createListeners = taskDefinition.getTaskListeners(event);
assertEquals(1, createListeners.size());
TaskListener listener = createListeners.get(0);
assertTrue(listener instanceof DelegateExpressionTaskListener);
DelegateExpressionTaskListener delegateExpressionListener = (DelegateExpressionTaskListener) listener;
assertEquals(delegateExpression, delegateExpressionListener.getExpressionText());
assertTrue(delegateExpressionListener.getFieldDeclarations().isEmpty());
}
Aggregations