Search in sources :

Example 1 with RootElement

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

the class ProcessTest method shouldImportProcess.

@Test
@BpmnModelResource
public void shouldImportProcess() {
    ModelElementInstance modelElementById = bpmnModelInstance.getModelElementById("exampleProcessId");
    assertThat(modelElementById).isNotNull();
    Collection<RootElement> rootElements = bpmnModelInstance.getDefinitions().getRootElements();
    assertThat(rootElements).hasSize(1);
    org.camunda.bpm.model.bpmn.instance.Process process = (Process) rootElements.iterator().next();
    assertThat(process.getId()).isEqualTo("exampleProcessId");
    assertThat(process.getName()).isNull();
    assertThat(process.getProcessType()).isEqualTo(ProcessType.None);
    assertThat(process.isExecutable()).isFalse();
    assertThat(process.isClosed()).isFalse();
}
Also used : RootElement(org.camunda.bpm.model.bpmn.instance.RootElement) ModelElementInstance(org.camunda.bpm.model.xml.instance.ModelElementInstance) Process(org.camunda.bpm.model.bpmn.instance.Process) Process(org.camunda.bpm.model.bpmn.instance.Process) BpmnModelResource(org.camunda.bpm.model.bpmn.util.BpmnModelResource) Test(org.junit.Test)

Aggregations

Process (org.camunda.bpm.model.bpmn.instance.Process)1 RootElement (org.camunda.bpm.model.bpmn.instance.RootElement)1 BpmnModelResource (org.camunda.bpm.model.bpmn.util.BpmnModelResource)1 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)1 Test (org.junit.Test)1