Search in sources :

Example 91 with CmmnActivity

use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.

the class StageDiscretionaryItemHandlerTest method testActivityBehavior.

@Test
public void testActivityBehavior() {
    // given: a discretionaryItem
    // when
    CmmnActivity activity = handler.handleElement(discretionaryItem, context);
    // then
    CmmnActivityBehavior behavior = activity.getActivityBehavior();
    assertTrue(behavior instanceof StageActivityBehavior);
}
Also used : StageActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.StageActivityBehavior) CmmnActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CmmnActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 92 with CmmnActivity

use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.

the class StageDiscretionaryItemHandlerTest method testStageDescription.

@Test
public void testStageDescription() {
    // given
    String description = "This is a stage";
    stage.setDescription(description);
    // when
    CmmnActivity activity = handler.handleElement(discretionaryItem, context);
    // then
    assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
}
Also used : CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 93 with CmmnActivity

use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.

the class StageDiscretionaryItemHandlerTest method testStageActivityType.

@Test
public void testStageActivityType() {
    // given
    // when
    CmmnActivity activity = handler.handleElement(discretionaryItem, context);
    // then
    String activityType = (String) activity.getProperty(PROPERTY_ACTIVITY_TYPE);
    assertEquals("stage", activityType);
}
Also used : CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 94 with CmmnActivity

use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.

the class StagePlanItemHandlerTest method testManualActivationRule.

@Test
public void testManualActivationRule() {
    // given
    ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
    ManualActivationRule manualActivationRule = createElement(itemControl, "ManualActivationRule_1", ManualActivationRule.class);
    ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
    expression.setText("${true}");
    Cmmn.validateModel(modelInstance);
    // when
    CmmnActivity newActivity = handler.handleElement(planItem, context);
    // then
    Object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);
    assertNotNull(rule);
    assertTrue(rule instanceof CaseControlRule);
}
Also used : ManualActivationRule(org.camunda.bpm.model.cmmn.instance.ManualActivationRule) PlanItemControl(org.camunda.bpm.model.cmmn.instance.PlanItemControl) ItemControl(org.camunda.bpm.model.cmmn.instance.ItemControl) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CaseControlRule(org.camunda.bpm.engine.impl.cmmn.CaseControlRule) Test(org.junit.Test)

Example 95 with CmmnActivity

use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.

the class StagePlanItemHandlerTest method testWithoutParent.

@Test
public void testWithoutParent() {
    // given: a planItem
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    assertNull(activity.getParent());
}
Also used : CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Aggregations

CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)325 Test (org.junit.Test)298 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)112 PlanItemControl (org.camunda.bpm.model.cmmn.instance.PlanItemControl)64 CaseControlRule (org.camunda.bpm.engine.impl.cmmn.CaseControlRule)47 CmmnSentryDeclaration (org.camunda.bpm.engine.impl.cmmn.model.CmmnSentryDeclaration)47 ExtensionElements (org.camunda.bpm.model.cmmn.instance.ExtensionElements)39 Sentry (org.camunda.bpm.model.cmmn.instance.Sentry)39 IfPart (org.camunda.bpm.model.cmmn.instance.IfPart)37 CasePlanModelHandler (org.camunda.bpm.engine.impl.cmmn.handler.CasePlanModelHandler)36 SentryHandler (org.camunda.bpm.engine.impl.cmmn.handler.SentryHandler)35 CallableElement (org.camunda.bpm.engine.impl.core.model.CallableElement)34 ItemControl (org.camunda.bpm.model.cmmn.instance.ItemControl)32 HumanTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)29 RepetitionRule (org.camunda.bpm.model.cmmn.instance.RepetitionRule)28 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)26 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)23 Body (org.camunda.bpm.model.cmmn.instance.Body)23 EntryCriterion (org.camunda.bpm.model.cmmn.instance.EntryCriterion)21 ExitCriterion (org.camunda.bpm.model.cmmn.instance.ExitCriterion)21