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

            return(process.property);
        }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #5
0
ファイル: BpmnetParser.cs プロジェクト: chubbyerror/BpmNet
 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();
         }
     }));
 }
コード例 #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();
         }
     }));
 }
コード例 #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.
                }
            }
        }
コード例 #8
0
 public BpmnNetProcess(tProcess process)
 {
     _process = process;
 }
コード例 #9
0
 public IEnumerable <tStartEvent> GetStartItem(tProcess process)
 {
     return(process.Items.OfType <tStartEvent>());
 }
コード例 #10
0
 public IEnumerable <tFlowNode> getFlowNode(tProcess process)
 {
     process.ThrowIfNull();
     return(process.Items.OfType <tFlowNode>());
 }
コード例 #11
0
 public tSequenceFlow GetSequenceFlow(tProcess process, string id)
 {
     id.ThrowIfNull();
     return(process.Items.OfType <tSequenceFlow>().Single(t => t.id.Equals(id)));
 }
コード例 #12
0
 public tFlowElement GetFlowElement(tProcess process, string id)
 {
     id.ThrowIfNull();
     return(process.Items.Single(t => t.id.Equals(id)));
 }