cn.lzgabel.converter.processing.container.CallActivityProcessor Maven / Gradle / Ivy
package cn.lzgabel.converter.processing.container;
import cn.lzgabel.converter.bean.BaseDefinition;
import cn.lzgabel.converter.bean.subprocess.CallActivityDefinition;
import cn.lzgabel.converter.processing.BpmnElementProcessor;
import io.camunda.zeebe.model.bpmn.builder.AbstractFlowNodeBuilder;
import io.camunda.zeebe.model.bpmn.builder.CallActivityBuilder;
import io.camunda.zeebe.model.bpmn.instance.zeebe.ZeebeCalledElement;
import java.lang.reflect.InvocationTargetException;
import java.util.Objects;
/**
* 〈功能简述〉
* 〈CallActivity节点类型详情设置〉
*
* @author lizhi
* @since 1.0.0
*/
public class CallActivityProcessor
implements BpmnElementProcessor {
@Override
public String onComplete(AbstractFlowNodeBuilder flowNodeBuilder, CallActivityDefinition flowNode)
throws InvocationTargetException, IllegalAccessException {
CallActivityBuilder callActivityBuilder = flowNodeBuilder.callActivity();
callActivityBuilder.getElement().setName(flowNode.getNodeName());
callActivityBuilder.addExtensionElement(
ZeebeCalledElement.class,
(ZeebeCalledElement zeebeCalledElement) -> {
zeebeCalledElement.setProcessId(flowNode.getProcessId());
zeebeCalledElement.setPropagateAllChildVariablesEnabled(
flowNode.isPropagateAllChildVariablesEnabled());
callActivityBuilder.addExtensionElement(zeebeCalledElement);
});
String id = callActivityBuilder.getElement().getId();
BaseDefinition childNode = flowNode.getNextNode();
if (Objects.nonNull(childNode)) {
return onCreate(moveToNode(callActivityBuilder, id), childNode);
}
return id;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy