Java Code Examples for org.activiti.bpmn.model.BoundaryEvent#getAttachedToRefId()

The following examples show how to use org.activiti.bpmn.model.BoundaryEvent#getAttachedToRefId() . 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: BpmnAutoLayout.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected void handleBoundaryEvents() {
  for (BoundaryEvent boundaryEvent : boundaryEvents) {
    mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize);
    geometry.setOffset(new mxPoint(-(eventSize / 2), -(eventSize / 2)));
    geometry.setRelative(true);
    mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter");
    boundaryPort.setId("boundary-event-" + boundaryEvent.getId());
    boundaryPort.setVertex(true);

    Object portParent = null;
    if (boundaryEvent.getAttachedToRefId() != null) {
      portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId());
    } else if (boundaryEvent.getAttachedToRef() != null) {
      portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId());
    } else {
      throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef");
    }

    graph.addCell(boundaryPort, portParent);
    generatedVertices.put(boundaryEvent.getId(), boundaryPort);
  }
}
 
Example 2
Source File: MultiInstanceActivityBehavior.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
protected Collection<BoundaryEvent> findBoundaryEventsForFlowNode(final String processDefinitionId, final FlowElement flowElement) {
  Process process = getProcessDefinition(processDefinitionId);

  // This could be cached or could be done at parsing time
  List<BoundaryEvent> results = new ArrayList<BoundaryEvent>(1);
  Collection<BoundaryEvent> boundaryEvents = process.findFlowElementsOfType(BoundaryEvent.class, true);
  for (BoundaryEvent boundaryEvent : boundaryEvents) {
    if (boundaryEvent.getAttachedToRefId() != null && boundaryEvent.getAttachedToRefId().equals(flowElement.getId())) {
      results.add(boundaryEvent);
    }
  }
  return results;
}
 
Example 3
Source File: AbstractBpmnActivityBehavior.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
protected Collection<BoundaryEvent> findBoundaryEventsForFlowNode(final String processDefinitionId, final FlowElement flowElement) {
  Process process = getProcessDefinition(processDefinitionId);

  // This could be cached or could be done at parsing time
  List<BoundaryEvent> results = new ArrayList<BoundaryEvent>(1);
  Collection<BoundaryEvent> boundaryEvents = process.findFlowElementsOfType(BoundaryEvent.class, true);
  for (BoundaryEvent boundaryEvent : boundaryEvents) {
    if (boundaryEvent.getAttachedToRefId() != null && boundaryEvent.getAttachedToRefId().equals(flowElement.getId())) {
      results.add(boundaryEvent);
    }
  }
  return results;
}