org.camunda.bpm.model.bpmn.builder.StartEventBuilder Java Examples

The following examples show how to use org.camunda.bpm.model.bpmn.builder.StartEventBuilder. 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: BpmnProcessModelCustomizer.java    From wecube-platform with Apache License 2.0 4 votes vote down vote up
protected void supplementSubProcess(SubProcess subProc) {
    String subProcId = subProc.getId();

    String userTaskId = "exceptSubUT-" + subProcId;
    String srvBeanServiceTaskId = String.format("srvBeanST-%s", subProcId);
    String actRetryExpr = String.format("${ act_%s == 'retry' }", subProcId);
    String actSkipExpr = String.format("${ act_%s == 'skip' }", subProcId);
    String catchEventId = subProcId + "_ice1";
    String signalId = subProcId + "_sig1";
    String retCodeOkExpr = String.format("${retCode_%s != '1'}", catchEventId);
    String retCodeNotOkExpr = String.format("${retCode_%s == '1'}", catchEventId);

    StartEventBuilder b = subProc.builder().embeddedSubProcess().startEvent(subProcId + "_startEvent1")
            .name("St1_" + subProcId);
    EndEventBuilder eb = b.serviceTask(srvBeanServiceTaskId).name("T1_" + subProcId) //
            .eventBasedGateway().name("EGW1_" + subProcId) //
            .intermediateCatchEvent(catchEventId).name("ICE1_" + subProcId) //
            .signal(signalId) //
            .exclusiveGateway().gatewayDirection(GatewayDirection.Diverging) //
            .condition("con1", retCodeOkExpr) //
            .endEvent(subProcId + "_endEvent1").name("End1_" + subProcId) //
            .moveToLastGateway() //
            .condition("con2", retCodeNotOkExpr) //
            .serviceTask("srvFailBeanST-" + subProcId) //
            .name("SRV-FAIL-HANDLER_" + subProcId).camundaDelegateExpression("${srvFailBean}") //
            .userTask(userTaskId).name("EXCEPTION-HANDLER_" + subProcId) //
            .condition("con4", actRetryExpr) //
            .connectTo(srvBeanServiceTaskId) //
            .moveToActivity(userTaskId) //
            .condition("con3", actSkipExpr) //
            .endEvent().name("End2_" + subProcId);

    String subProcessTimeoutExpr = getSubProcessTimeoutExpression(subProc);
    if (StringUtils.isNotBlank(subProcessTimeoutExpr)) {
        AbstractFlowNodeBuilder<?, ?> ab = eb.moveToLastGateway().moveToLastGateway()
                .intermediateCatchEvent(subProcId + "_time1").timerWithDuration(subProcessTimeoutExpr)
                .serviceTask("srvTimeOutBeanST-" + subProcId).name("SRV-TIMEOUT-HANDLER_" + subProcId)
                .camundaDelegateExpression("${srvTimeoutBean}").connectTo(userTaskId);
        ab.done();
    } else {
        eb.done();
    }

}
 
Example #2
Source File: StartEventImpl.java    From camunda-bpmn-model with Apache License 2.0 4 votes vote down vote up
@Override
public StartEventBuilder builder() {
  return new StartEventBuilder((BpmnModelInstance) modelInstance, this);
}
 
Example #3
Source File: StartEventImpl.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
public StartEventBuilder builder() {
  return new StartEventBuilder((BpmnModelInstance) modelInstance, this);
}
 
Example #4
Source File: StartEvent.java    From camunda-bpmn-model with Apache License 2.0 votes vote down vote up
StartEventBuilder builder(); 
Example #5
Source File: StartEvent.java    From camunda-bpm-platform with Apache License 2.0 votes vote down vote up
StartEventBuilder builder();