Search in sources :

Example 1 with Expression

use of org.camunda.bpm.model.bpmn.instance.Expression in project camunda-bpmn-model by camunda.

the class CamundaExtensionsTest method testPotentialStarter.

@Test
public void testPotentialStarter() {
    CamundaPotentialStarter potentialStarter = startEvent.getExtensionElements().getElementsQuery().filterByType(CamundaPotentialStarter.class).singleResult();
    Expression expression = potentialStarter.getResourceAssignmentExpression().getExpression();
    assertThat(expression.getTextContent()).isEqualTo(TEST_GROUPS_XML);
    expression.setTextContent(TEST_GROUPS_API);
    assertThat(expression.getTextContent()).isEqualTo(TEST_GROUPS_API);
}
Also used : Expression(org.camunda.bpm.model.bpmn.instance.Expression) CamundaPotentialStarter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaPotentialStarter) Test(org.junit.Test)

Example 2 with Expression

use of org.camunda.bpm.model.bpmn.instance.Expression in project camunda-bpmn-model by camunda.

the class ExpressionImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Expression.class, BPMN_ELEMENT_EXPRESSION).namespaceUri(BPMN20_NS).extendsType(BaseElement.class).instanceProvider(new ModelTypeInstanceProvider<Expression>() {

        public Expression newInstance(ModelTypeInstanceContext instanceContext) {
            return new ExpressionImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : BaseElement(org.camunda.bpm.model.bpmn.instance.BaseElement) Expression(org.camunda.bpm.model.bpmn.instance.Expression) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

Expression (org.camunda.bpm.model.bpmn.instance.Expression)2 BaseElement (org.camunda.bpm.model.bpmn.instance.BaseElement)1 CamundaPotentialStarter (org.camunda.bpm.model.bpmn.instance.camunda.CamundaPotentialStarter)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 Test (org.junit.Test)1