use of org.camunda.bpm.model.bpmn.instance.StartEvent in project camunda-bpmn-model by camunda.
the class GenerateIdTest method shouldGenerateIdsOnCreate.
@Test
public void shouldGenerateIdsOnCreate() {
BpmnModelInstance modelInstance = Bpmn.createEmptyModel();
Definitions definitions = modelInstance.newInstance(Definitions.class);
assertThat(definitions.getId()).isNotNull();
Process process = modelInstance.newInstance(Process.class);
assertThat(process.getId()).isNotNull();
StartEvent startEvent = modelInstance.newInstance(StartEvent.class);
assertThat(startEvent.getId()).isNotNull();
UserTask userTask = modelInstance.newInstance(UserTask.class);
assertThat(userTask.getId()).isNotNull();
}
use of org.camunda.bpm.model.bpmn.instance.StartEvent in project camunda-bpmn-model by camunda.
the class AbstractEventSubProcessBuilder method startEvent.
public StartEventBuilder startEvent(String id) {
StartEvent start = createChild(StartEvent.class, id);
BpmnShape startShape = createBpmnShape(start);
BpmnShape subProcessShape = findBpmnShape(getElement());
if (subProcessShape != null) {
Bounds subProcessBounds = subProcessShape.getBounds();
Bounds startBounds = startShape.getBounds();
double subProcessX = subProcessBounds.getX();
double subProcessY = subProcessBounds.getY();
double subProcessHeight = subProcessBounds.getHeight();
double startHeight = startBounds.getHeight();
startBounds.setX(subProcessX + SPACE);
startBounds.setY(subProcessY + subProcessHeight / 2 - startHeight / 2);
}
return start.builder();
}
Aggregations