loadEventObj(processDefinitionBehavior);
return processDefinitionBehavior;
}
private void loadEventObj(BaseElement baseElement) {
BaseElementImpl baseElementImpl = (BaseElementImpl) baseElement;
if (baseElement instanceof SubProcess) {
SubProcess subProcess = (SubProcess) baseElement;
List<FlowElement> flowElements = subProcess.getFlowElements();
for (FlowElement flowElement : flowElements) {
if (flowElement instanceof Activity) {
loadEventObj(flowElement);
}
}
}
List<ConnectorInstance> connectorInstances = baseElementImpl.getConnectorInstances();
if (connectorInstances != null) {
for (ConnectorInstance connectorInstance : connectorInstances) {
String packageNamesString = connectorInstance.getPackageName();
String classNameString = connectorInstance.getClassName();
String eventTypeString = connectorInstance.getEventType();
String connectorIdString = connectorInstance.getConnectorId();
String connectorInstanceIdString = connectorInstance.getConnectorInstanceId();
String connectorInstanceNameString = connectorInstance.getConnectorInstanceName();
String errorHandlingString = connectorInstance.getErrorHandling();
String errorCodeString = connectorInstance.getErrorCode();
boolean isTimeExecute = connectorInstance.isIsTimeExecute();
String documentationString = connectorInstance.getDocumentation().getValue();
String skipExpression = null;
if (connectorInstance.getSkipComment() != null) {
skipExpression = connectorInstance.getSkipComment().getExpression().getValue();
}
String timeExpression = null;
if (connectorInstance.getTimeExpression() != null) {
timeExpression = connectorInstance.getTimeExpression().getExpression().getValue();
}
ConnectorInstanceBehavior connectorInstanceBehavior = new ConnectorInstanceBehavior();
connectorInstanceBehavior.setConnectorId(connectorIdString);
connectorInstanceBehavior.setConnectorInstanceId(connectorInstanceIdString);
connectorInstanceBehavior.setClassName(classNameString);
connectorInstanceBehavior.setConnectorInstanceName(connectorInstanceNameString);
connectorInstanceBehavior.setDocumentation(documentationString);
connectorInstanceBehavior.setErrorCode(errorCodeString);
connectorInstanceBehavior.setErrorHandling(errorHandlingString);
connectorInstanceBehavior.setEventType(eventTypeString);
connectorInstanceBehavior.setPackageName(packageNamesString);
connectorInstanceBehavior.setSkipExpression(skipExpression);
if (isTimeExecute) {
connectorInstanceBehavior.setTimeExecute(true);
connectorInstanceBehavior.setTimeExpression(timeExpression);
} else {
connectorInstanceBehavior.setTimeExecute(false);
}
if (baseElementImpl.getEvents().get(eventTypeString) == null) {
BaseElementEventImpl flowNodeEventImpl = new BaseElementEventImpl(eventTypeString);
flowNodeEventImpl.addConnector(connectorInstanceBehavior);
baseElementImpl.addEvent(flowNodeEventImpl);
} else {
baseElementImpl.getEvents().get(eventTypeString).addConnector(connectorInstanceBehavior);
}
List<ConnectorParameterInputs> connectorParameterInputs = connectorInstance.getConnectorParameterInputs();
connectorInstanceBehavior.getConnectorParameterInputs().clear();
connectorInstanceBehavior.getConnectorParameterInputs().addAll(connectorParameterInputs);
List<ConnectorParameterOutputs> connectorParameterOutputs = connectorInstance.getConnectorParameterOutputs();