Search in sources :

Example 1 with ManualActivationRule

use of org.camunda.bpm.model.cmmn.instance.ManualActivationRule in project camunda-bpm-platform by camunda.

the class HumanTaskDicretionaryItemHandlerTest method testManualActivationRule.

@Test
public void testManualActivationRule() {
    // given
    ItemControl itemControl = createElement(discretionaryItem, "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(discretionaryItem, 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 2 with ManualActivationRule

use of org.camunda.bpm.model.cmmn.instance.ManualActivationRule in project camunda-bpm-platform by camunda.

the class HumanTaskDicretionaryItemHandlerTest method testManualActivationRuleByDefaultPlanItemControl.

@Test
public void testManualActivationRuleByDefaultPlanItemControl() {
    // given
    PlanItemControl defaultControl = createElement(humanTask, "ItemControl_1", DefaultControl.class);
    ManualActivationRule manualActivationRule = createElement(defaultControl, "ManualActivationRule_1", ManualActivationRule.class);
    ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
    expression.setText("${true}");
    Cmmn.validateModel(modelInstance);
    // when
    CmmnActivity newActivity = handler.handleElement(discretionaryItem, 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) ConditionExpression(org.camunda.bpm.model.cmmn.instance.ConditionExpression) PlanItemControl(org.camunda.bpm.model.cmmn.instance.PlanItemControl) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CaseControlRule(org.camunda.bpm.engine.impl.cmmn.CaseControlRule) Test(org.junit.Test)

Example 3 with ManualActivationRule

use of org.camunda.bpm.model.cmmn.instance.ManualActivationRule in project camunda-bpm-platform by camunda.

the class ProcessTaskPlanItemHandlerTest 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 4 with ManualActivationRule

use of org.camunda.bpm.model.cmmn.instance.ManualActivationRule 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 5 with ManualActivationRule

use of org.camunda.bpm.model.cmmn.instance.ManualActivationRule in project camunda-bpm-platform by camunda.

the class TaskPlanItemHandlerTest 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)

Aggregations

ManualActivationRule (org.camunda.bpm.model.cmmn.instance.ManualActivationRule)18 CaseControlRule (org.camunda.bpm.engine.impl.cmmn.CaseControlRule)17 PlanItemControl (org.camunda.bpm.model.cmmn.instance.PlanItemControl)17 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)16 ConditionExpression (org.camunda.bpm.model.cmmn.instance.ConditionExpression)16 Test (org.junit.Test)16 ItemControl (org.camunda.bpm.model.cmmn.instance.ItemControl)8 CmmnElement (org.camunda.bpm.model.cmmn.instance.CmmnElement)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1