Java Code Examples for org.camunda.bpm.model.bpmn.instance.StartEvent#builder()

The following examples show how to use org.camunda.bpm.model.bpmn.instance.StartEvent#builder() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractEventSubProcessBuilder.java    From camunda-bpmn-model with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 2
Source File: EmbeddedSubProcessBuilder.java    From camunda-bpmn-model with Apache License 2.0 6 votes vote down vote up
public StartEventBuilder startEvent(String id) {
  StartEvent start = subProcessBuilder.createChild(StartEvent.class, id);

  BpmnShape startShape = subProcessBuilder.createBpmnShape(start);
  BpmnShape subProcessShape = subProcessBuilder.findBpmnShape(subProcessBuilder.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();
}
 
Example 3
Source File: AbstractEventSubProcessBuilder.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 4
Source File: EmbeddedSubProcessBuilder.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public StartEventBuilder startEvent(String id) {
  StartEvent start = subProcessBuilder.createChild(StartEvent.class, id);

  BpmnShape startShape = subProcessBuilder.createBpmnShape(start);
  BpmnShape subProcessShape = subProcessBuilder.findBpmnShape(subProcessBuilder.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();
}
 
Example 5
Source File: ProcessBuilder.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
public StartEventBuilder startEvent(String id) {
  StartEvent start = createChild(StartEvent.class, id);
  BpmnShape bpmnShape = createBpmnShape(start);
  setCoordinates(bpmnShape);
  return start.builder();
}
 
Example 6
Source File: ProcessBuilder.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public StartEventBuilder startEvent(String id) {
  StartEvent start = createChild(StartEvent.class, id);
  BpmnShape bpmnShape = createBpmnShape(start);
  setCoordinates(bpmnShape);
  return start.builder();
}