Search in sources :

Example 11 with CamundaOut

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

the class CaseTaskPlanItemHandlerTest method testOutputVariables.

@Test
public void testOutputVariables() {
    // given:
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaOut variablesElement = createElement(extensionElements, null, CamundaOut.class);
    variablesElement.setCamundaVariables("all");
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getOutputs().get(0);
    assertNotNull(parameter);
    assertTrue(parameter.isAllVariables());
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) CallableElementParameter(org.camunda.bpm.engine.impl.core.model.CallableElementParameter) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 12 with CamundaOut

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

the class CamundaOutImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaOut.class, CAMUNDA_ELEMENT_OUT).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaOut>() {

        public CamundaOut newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaOutImpl(instanceContext);
        }
    });
    camundaSourceAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE).namespace(CAMUNDA_NS).build();
    camundaSourceExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION).namespace(CAMUNDA_NS).build();
    camundaVariablesAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLES).namespace(CAMUNDA_NS).build();
    camundaTargetAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TARGET).namespace(CAMUNDA_NS).build();
    typeBuilder.build();
}
Also used : ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

CamundaOut (org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut)12 CallableElementParameter (org.camunda.bpm.engine.impl.core.model.CallableElementParameter)11 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)10 CallableElement (org.camunda.bpm.engine.impl.core.model.CallableElement)10 ExtensionElements (org.camunda.bpm.model.cmmn.instance.ExtensionElements)10 Test (org.junit.Test)10 CaseTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior)5 ProcessTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior)5 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)5 ConstantValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider)2 ElValueProvider (org.camunda.bpm.engine.impl.el.ElValueProvider)2 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1