public IEnumerable <tProperty> GetProcessProperties(tDefinitions definition, string processId) { processId.ThrowIfNull(); tProcess process = GetProcess(definition, processId); return(process.property); }
public bool TryGetFlowElement(tProcess process, string id, out tFlowElement elm) { elm = null; if (id == null) { return(false); } elm = process.Items.FirstOrDefault(t => t.id.Equals(id)); return(elm != null); }
public bool TryGetSequenceFlow(tProcess process, string id, out tSequenceFlow elm) { elm = null; if (id == null) { return(false); } elm = process.Items.OfType <tSequenceFlow>().FirstOrDefault(t => t.id.Equals(id)); return(elm != null); }
public bool TryGetProcess(string id, out tProcess process) { process = null; if (id == null) { return(false); } process = Definition.Items.OfType <tProcess>().FirstOrDefault(t => t.id.Equals(id)); return(process != null); }
public static async Task <string> SerializeProcessAsync(tProcess process) { return(await Task.Run(() => { using (var textWriter = new StringWriter()) { var xmlSerializer = new XmlSerializer(typeof(tProcess)); xmlSerializer.Serialize(textWriter, process); return textWriter.ToString(); } })); }
public Task <string> SerializeProcessAsync(tProcess process) { return(Task.Factory.StartNew(() => { using (var textWriter = new StringWriter()) { var xmlSerializer = new XmlSerializer(typeof(tProcess)); xmlSerializer.Serialize(textWriter, process); return textWriter.ToString(); } })); }
/// <summary> /// Get Next sequence for process /// </summary> /// <param name="process">Current Process to find next sequence</param> /// <param name="flowId">id of current flow element</param> /// <returns></returns> public IEnumerable <tFlowElement> GetNextSequence(tProcess process, string flowId) { //Check From Incoming var tFlowElement = getFlowNode(process).FirstOrDefault(t => t.id.Equals(flowId)); if (tFlowElement != null && tFlowElement.incoming != null && tFlowElement.incoming.Length > 0) { foreach (var item in tFlowElement.incoming) { if (item.Name != null) { tSequenceFlow sequenceFlow; if (TryGetSequenceFlow(process, item.Name, out sequenceFlow)) { yield return(GetFlowElement(process, sequenceFlow.targetRef));; } } } } else // Incoming not found in node, so looking in sequence flow { var sequenceFlows = process.Items.OfType <tSequenceFlow>().Where(t => t.sourceRef.Equals(flowId)); // TODO add filter For a Process: Of the types of FlowNode, only Activities, Gateways, and Events // can be the source. However, Activities that are Event Sub - Processes are not // allowed to be a source. // For a Choreography: Of the types of FlowNode, only Choreography Activities, // Gateways, and Events can be the source. foreach (var item in sequenceFlows) { //TODO Get condition and isImmediate. yield return(GetFlowElement(process, item.targetRef)); // TODO add filter For a Process: Of the types of FlowNode, only Activities, Gateways, and Events // can be the target. However, Activities that are Event Sub - Processes are not allowed to be a target. // For a Choreography: Of the types of FlowNode, only Choreography Activities, // Gateways, and Events can be the target. } } }
public BpmnNetProcess(tProcess process) { _process = process; }
public IEnumerable <tStartEvent> GetStartItem(tProcess process) { return(process.Items.OfType <tStartEvent>()); }
public IEnumerable <tFlowNode> getFlowNode(tProcess process) { process.ThrowIfNull(); return(process.Items.OfType <tFlowNode>()); }
public tSequenceFlow GetSequenceFlow(tProcess process, string id) { id.ThrowIfNull(); return(process.Items.OfType <tSequenceFlow>().Single(t => t.id.Equals(id))); }
public tFlowElement GetFlowElement(tProcess process, string id) { id.ThrowIfNull(); return(process.Items.Single(t => t.id.Equals(id))); }