Exemplo n.º 1
0
        /// <summary>
        /// 添加一个执行器到队列queuedInvocations并执行
        /// </summary>
        /// <param name="executionOperation">执行器</param>
        /// <param name="execution"></param>
        /// <param name="performAsync">是否异步</param>
        public virtual void PerformOperation(IAtomicOperation executionOperation, ExecutionEntity execution,
                                             bool performAsync)
        {
            AtomicOperationInvocation invocation = new AtomicOperationInvocation(executionOperation, execution, performAsync);

            queuedInvocations.Enqueue(invocation);//.Insert(0, invocation);
            PerformNext();
        }
Exemplo n.º 2
0
        protected internal virtual void InvokeNext()
        {
            //AtomicOperationInvocation invocation = queuedInvocations.RemoveAt(0);
            AtomicOperationInvocation invocation = queuedInvocations.Dequeue();; //.FirstOrDefault();

            //TODO 暂时取消异常拦截
            try
            {
                invocation.Execute(BpmnStackTrace);
            }
            catch (System.Exception e)
            {
                // log bpmn stacktrace
                BpmnStackTrace.PrintStackTrace(Context.ProcessEngineConfiguration.BpmnStacktraceVerbose);
                TrySetThrowable(e);
                Rethrow();
            }
        }
Exemplo n.º 3
0
        protected internal virtual void WriteInvocation(AtomicOperationInvocation invocation, StringWriter writer)
        {
            writer.Write("\t");
            writer.Write(invocation.ActivityId);
            writer.Write(" (");
            writer.Write(invocation.Operation.CanonicalName);
            writer.Write(", ");
            writer.Write(invocation.Execution.ToString());

            if (invocation.PerformAsync)
            {
                writer.Write(", ASYNC");
            }

            if (!ReferenceEquals(invocation.ApplicationContextName, null))
            {
                writer.Write(", pa=");
                writer.Write(invocation.ApplicationContextName);
            }

            writer.Write(")\n");
        }
Exemplo n.º 4
0
 public virtual void Add(AtomicOperationInvocation atomicOperationInvocation)
 {
     PerfromedInvocations.Add(atomicOperationInvocation);
 }