public BoundaryEventBuilder boundaryEvent() { return boundaryEvent(null); }
protected void setBoundaryEventCoordinates(BpmnShape bpmnShape) { BpmnShape activity = findBpmnShape(element); Bounds boundaryBounds = bpmnShape.getBounds(); double x = 0; double y = 0; if (activity != null) { Bounds activityBounds = activity.getBounds(); double activityY = activityBounds.getY(); double activityHeight = activityBounds.getHeight(); double boundaryHeight = boundaryBounds.getHeight(); x = calculateXCoordinate(boundaryBounds); y = activityY + activityHeight - boundaryHeight / 2; } boundaryBounds.setX(x); boundaryBounds.setY(y); }
public BoundaryEventBuilder boundaryEvent(String id) { BoundaryEvent boundaryEvent = createSibling(BoundaryEvent.class, id); boundaryEvent.setAttachedTo(element); BpmnShape boundaryEventBpmnShape = createBpmnShape(boundaryEvent); setBoundaryEventCoordinates(boundaryEventBpmnShape); return boundaryEvent.builder(); }
/** * Creates a new camunda output parameter extension element with the * given name and value. * * @param name the name of the output parameter * @param value the value of the output parameter * @return the builder object */ public B camundaOutputParameter(String name, String value) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class); CamundaOutputParameter camundaOutputParameter = createChild(camundaInputOutput, CamundaOutputParameter.class); camundaOutputParameter.setCamundaName(name); camundaOutputParameter.setTextContent(value); return myself; }
protected BpmnModelInstance getBpmnModelInstance() { return Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .callActivity(CALL_ACTIVITY) .calledElement(SUB_PROCESS_ID) .multiInstance() .cardinality("2") .multiInstanceDone() .endEvent() .done(); }
.subProcessDone() .multiInstance().camundaCollection("${vars}").camundaElementVariable("loopVar").multiInstanceDone() .endEvent().done(); .camundaInputParameter("localVar", "${loopVar}") .camundaInputParameter("constVar", "someValue") //to test array of parameters .done();
public static void main(String[] args) { BpmnModelInstance model = Bpmn.createExecutableProcess("payment") .startEvent() .serviceTask().id("charge").name("Charge credit card").camundaClass(ChargeCreditCardAdapter.class.getName()) // .boundaryEvent().error() .serviceTask().name("Ask customer to update credit card").camundaExpression("#{true}") // noop .receiveTask().id("wait").name("Wait for new credit card data").message("CreditCardUpdated") .boundaryEvent().timerWithDuration("PT7D") // 7 days .endEvent().camundaExecutionListenerClass("end", PaymentFailedAdapter.class.getName()) .moveToActivity("wait").connectTo("charge") // loop back with new data .moveToActivity("charge") .endEvent().camundaExecutionListenerClass("end", PaymentCompletedAdapter.class.getName()) .done(); File file = new File("result.bpmn"); Bpmn.writeModelToFile(file, model); } }
public MultiInstanceLoopCharacteristicsBuilder multiInstance() { MultiInstanceLoopCharacteristics miCharacteristics = createChild(MultiInstanceLoopCharacteristics.class); return miCharacteristics.builder(); }
protected double calculateXCoordinate(Bounds boundaryEventBounds) { BpmnShape attachedToElement = findBpmnShape(element);
.subProcessDone() .multiInstance().camundaCollection("${vars}").camundaElementVariable("loopVar").multiInstanceDone() .endEvent().done();
/** * Creates a new camunda input parameter extension element with the * given name and value. * * @param name the name of the input parameter * @param value the value of the input parameter * @return the builder object */ public B camundaInputParameter(String name, String value) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class); CamundaInputParameter camundaInputParameter = createChild(camundaInputOutput, CamundaInputParameter.class); camundaInputParameter.setCamundaName(name); camundaInputParameter.setTextContent(value); return myself; }
.subProcessDone() .multiInstance().camundaCollection("${vars}").camundaElementVariable("loopVar").multiInstanceDone() .endEvent().done(); .camundaInputParameter("localVar", "${loopVar}") .camundaInputParameter("constVar", "someValue") //to test array of parameters .done();
public MultiInstanceLoopCharacteristicsBuilder multiInstance() { MultiInstanceLoopCharacteristics miCharacteristics = createChild(MultiInstanceLoopCharacteristics.class); return miCharacteristics.builder(); }
protected double calculateXCoordinate(Bounds boundaryEventBounds) { BpmnShape attachedToElement = findBpmnShape(element);
@Override public MigratingBpmnEventTrigger addBoundaryEvent(ProcessEngine engine, BpmnModelInstance modelInstance, String activityId, String boundaryEventId) { ModifiableBpmnModelInstance.wrap(modelInstance) .activityBuilder(activityId) .boundaryEvent(boundaryEventId) .message(MESSAGE_NAME) .done(); MessageTrigger trigger = new MessageTrigger(); trigger.engine = engine; trigger.messageName = MESSAGE_NAME; trigger.activityId = boundaryEventId; return trigger; }
.subProcessDone() .multiInstance().camundaCollection("${vars}").camundaElementVariable("loopVar").multiInstanceDone() .endEvent().done();
public BoundaryEventBuilder boundaryEvent(String id) { BoundaryEvent boundaryEvent = createSibling(BoundaryEvent.class, id); boundaryEvent.setAttachedTo(element); BpmnShape boundaryEventBpmnShape = createBpmnShape(boundaryEvent); setBoundaryEventCoordinates(boundaryEventBpmnShape); return boundaryEvent.builder(); }
/** * Creates a new camunda output parameter extension element with the * given name and value. * * @param name the name of the output parameter * @param value the value of the output parameter * @return the builder object */ public B camundaOutputParameter(String name, String value) { CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class); CamundaOutputParameter camundaOutputParameter = createChild(camundaInputOutput, CamundaOutputParameter.class); camundaOutputParameter.setCamundaName(name); camundaOutputParameter.setTextContent(value); return myself; }
protected void setBoundaryEventCoordinates(BpmnShape bpmnShape) { BpmnShape activity = findBpmnShape(element); Bounds boundaryBounds = bpmnShape.getBounds(); double x = 0; double y = 0; if (activity != null) { Bounds activityBounds = activity.getBounds(); double activityY = activityBounds.getY(); double activityHeight = activityBounds.getHeight(); double boundaryHeight = boundaryBounds.getHeight(); x = calculateXCoordinate(boundaryBounds); y = activityY + activityHeight - boundaryHeight / 2; } boundaryBounds.setX(x); boundaryBounds.setY(y); }
public MultiInstanceLoopCharacteristicsBuilder multiInstance() { MultiInstanceLoopCharacteristics miCharacteristics = createChild(MultiInstanceLoopCharacteristics.class); return miCharacteristics.builder(); }