Search in sources :

Example 1 with CamundaPotentialStarter

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

the class CamundaPotentialStarterImpl method registerType.

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

        public CamundaPotentialStarter newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaPotentialStarterImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    resourceAssignmentExpressionChild = sequenceBuilder.element(ResourceAssignmentExpression.class).build();
    typeBuilder.build();
}
Also used : SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) CamundaPotentialStarter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaPotentialStarter) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with CamundaPotentialStarter

use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaPotentialStarter 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)

Aggregations

CamundaPotentialStarter (org.camunda.bpm.model.bpmn.instance.camunda.CamundaPotentialStarter)2 Expression (org.camunda.bpm.model.bpmn.instance.Expression)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 Test (org.junit.Test)1