Exemple #1
0
        public IEnumerable <tProperty> GetProcessProperties(tDefinitions definition, string processId)
        {
            processId.ThrowIfNull();
            tProcess process = GetProcess(definition, processId);

            return(process.property);
        }
Exemple #2
0
 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);
 }
Exemple #3
0
 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);
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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();
         }
     }));
 }
Exemple #6
0
 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();
         }
     }));
 }
Exemple #7
0
        /// <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.
                }
            }
        }
Exemple #8
0
 public BpmnNetProcess(tProcess process)
 {
     _process = process;
 }
Exemple #9
0
 public IEnumerable <tStartEvent> GetStartItem(tProcess process)
 {
     return(process.Items.OfType <tStartEvent>());
 }
Exemple #10
0
 public IEnumerable <tFlowNode> getFlowNode(tProcess process)
 {
     process.ThrowIfNull();
     return(process.Items.OfType <tFlowNode>());
 }
Exemple #11
0
 public tSequenceFlow GetSequenceFlow(tProcess process, string id)
 {
     id.ThrowIfNull();
     return(process.Items.OfType <tSequenceFlow>().Single(t => t.id.Equals(id)));
 }
Exemple #12
0
 public tFlowElement GetFlowElement(tProcess process, string id)
 {
     id.ThrowIfNull();
     return(process.Items.Single(t => t.id.Equals(id)));
 }