public virtual TerminateEndEventActivityBehavior CreateTerminateEndEventActivityBehavior(EndEvent endEvent) { bool terminateAll = false; bool terminateMultiInstance = false; if (endEvent.EventDefinitions != null && endEvent.EventDefinitions.Count > 0 && endEvent.EventDefinitions[0] is TerminateEventDefinition) { terminateAll = ((TerminateEventDefinition)endEvent.EventDefinitions[0]).TerminateAll; terminateMultiInstance = ((TerminateEventDefinition)endEvent.EventDefinitions[0]).TerminateMultiInstance; } var extTerminateAll = endEvent.GetExtensionElementAttributeValue(nameof(terminateAll)); bool.TryParse(extTerminateAll, out terminateAll); var extTerminateMul = endEvent.GetExtensionElementAttributeValue(nameof(terminateMultiInstance)); bool.TryParse(extTerminateMul, out terminateMultiInstance); TerminateEndEventActivityBehavior terminateEndEventActivityBehavior = new TerminateEndEventActivityBehavior { TerminateAll = terminateAll, TerminateMultiInstance = terminateMultiInstance }; return(terminateEndEventActivityBehavior); }
public virtual TerminateEndEventActivityBehavior CreateTerminateEndEventActivityBehavior(EndEvent endEvent) { bool terminateAll = false; bool terminateMultiInstance = false; if (endEvent.EventDefinitions != null && endEvent.EventDefinitions.Count > 0 && endEvent.EventDefinitions[0] is TerminateEventDefinition) { terminateAll = ((TerminateEventDefinition)endEvent.EventDefinitions[0]).TerminateAll; terminateMultiInstance = ((TerminateEventDefinition)endEvent.EventDefinitions[0]).TerminateMultiInstance; } TerminateEndEventActivityBehavior terminateEndEventActivityBehavior = new TerminateEndEventActivityBehavior { TerminateAll = terminateAll, TerminateMultiInstance = terminateMultiInstance }; return(terminateEndEventActivityBehavior); }