use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-bpm-platform by camunda.
the class CmmnTransformerTest method setup.
@Before
public void setup() {
CmmnTransformer transformerWrapper = new CmmnTransformer(null, new DefaultCmmnElementHandlerRegistry(), null);
transformer = new CmmnTransform(transformerWrapper);
deployment = new DeploymentEntity();
deployment.setId("aDeploymentId");
transformer.setDeployment(deployment);
modelInstance = Cmmn.createEmptyModel();
definitions = modelInstance.newInstance(Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);
caseDefinition = createElement(definitions, "aCaseDefinition", Case.class);
casePlanModel = createElement(caseDefinition, "aCasePlanModel", CasePlanModel.class);
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-cmmn-model by camunda.
the class CmmnModelInstanceTest method testClone.
@Test
public void testClone() throws Exception {
CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
Definitions definitions = modelInstance.newInstance(Definitions.class);
definitions.setId("TestId");
modelInstance.setDefinitions(definitions);
CmmnModelInstance cloneInstance = modelInstance.clone();
cloneInstance.getDefinitions().setId("TestId2");
assertThat(modelInstance.getDefinitions().getId(), is(equalTo("TestId")));
assertThat(cloneInstance.getDefinitions().getId(), is(equalTo("TestId2")));
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-cmmn-model by camunda.
the class GenerateIdTest method shouldGenerateIdsOnCreate.
@Test
public void shouldGenerateIdsOnCreate() {
CmmnModelInstance modelInstance = Cmmn.createEmptyModel();
Definitions definitions = modelInstance.newInstance(Definitions.class);
assertThat(definitions.getId()).isNotNull();
Case caseElement = modelInstance.newInstance(Case.class);
assertThat(caseElement.getId()).isNotNull();
CasePlanModel casePlanModel = modelInstance.newInstance(CasePlanModel.class);
assertThat(casePlanModel.getId()).isNotNull();
HumanTask humanTask = modelInstance.newInstance(HumanTask.class);
assertThat(humanTask.getId()).isNotNull();
}
use of org.camunda.bpm.model.cmmn.instance.Definitions in project camunda-cmmn-model by camunda.
the class DefinitionsImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Definitions.class, CMMN_ELEMENT_DEFINITIONS).namespaceUri(CMMN11_NS).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<Definitions>() {
public Definitions newInstance(ModelTypeInstanceContext instanceContext) {
return new DefinitionsImpl(instanceContext);
}
});
idAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ID).idAttribute().build();
nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME).build();
targetNamespaceAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_NAMESPACE).required().build();
expressionLanguageAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPRESSION_LANGUAGE).defaultValue(XPATH_NS).build();
exporterAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPORTER).build();
exporterVersionAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPORTER_VERSION).build();
authorAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_AUTHOR).build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
importCollection = sequenceBuilder.elementCollection(Import.class).build();
caseFileItemDefinitionCollection = sequenceBuilder.elementCollection(CaseFileItemDefinition.class).build();
caseCollection = sequenceBuilder.elementCollection(Case.class).build();
processCollection = sequenceBuilder.elementCollection(Process.class).build();
decisionCollection = sequenceBuilder.elementCollection(Decision.class).build();
extensionElementsChild = sequenceBuilder.element(ExtensionElements.class).minOccurs(0).maxOccurs(1).build();
relationshipCollection = sequenceBuilder.elementCollection(Relationship.class).build();
artifactCollection = sequenceBuilder.elementCollection(Artifact.class).build();
typeBuilder.build();
}
Aggregations