예제 #1
0
        void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
        {
            Console.WriteLine(processNode.NodeName + " Executing Sequence");
            bool result = true;

            if (processNode.Expression != null)
            {
                Console.WriteLine(processNode.NodeName + " Conditional Sequence");
                Console.WriteLine("Condition: " + processNode.Expression);
                var globals = new Globals(processNode.InputParameters.ToDictionary(e => e.Key, e => e.Value));
                try
                {
                    result = CSharpScript.EvaluateAsync <bool>(processNode.Expression, globals: globals).Result;
                    Console.WriteLine("Condition result: " + result.ToString());
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }

            if (result)
            {
                processNode.Done();
            }
        }
예제 #2
0
 void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
 {
     Console.WriteLine(processNode.NodeName);
     sequenceWait.GetOrAdd(processNode, new List <ProcessNode>(processNode.PreviousNodes));
     lock (sequenceWait[processNode])
     {
         sequenceWait[processNode].Remove(previousNode);
     }
     if (sequenceWait[processNode].Count == 0)
     {
         processNode.Done();
     }
 }
예제 #3
0
        void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
        {
            Console.WriteLine(processNode.NodeName + " Executing Script");

            if (processNode.Expression != null)
            {
                Console.WriteLine("Script: " + processNode.Expression);
                var globals = new Globals(processNode.InputParameters.ToDictionary(e => e.Key, e => e.Value));
                try
                {
                    processNode.OutputParameters =
                        CSharpScript.EvaluateAsync <IDictionary <string, object> >(processNode.Expression, globals: globals)
                        .Result.ToImmutableDictionary();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
            processNode.Done();
        }
예제 #4
0
 void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
 {
     Console.WriteLine(processNode.NodeName + " Executing End");
     processNode.ProcessInstance.SetOutputParameters(processNode);
     processNode.Done();
 }
예제 #5
0
 void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
 {
     Console.WriteLine(processNode.NodeName + " Executing BusinessRule");
     processNode.Done();
 }
예제 #6
0
 void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
 {
     Console.WriteLine(processNode.NodeName);
     processNode.Done();
 }
예제 #7
0
 void INodeHandler.Execute(ProcessNode processNode, ProcessNode previousNode)
 {
     Console.WriteLine(processNode.NodeName + " Executing Exclusive Gateway (default)");
     processNode.Done();
 }