Пример #1
0
        protected internal virtual void updateAsyncAfterTargetConfiguration(AsyncContinuationConfiguration currentConfiguration)
        {
            ActivityImpl          targetActivity      = (ActivityImpl)targetScope;
            IList <PvmTransition> outgoingTransitions = targetActivity.OutgoingTransitions;

            AsyncContinuationConfiguration targetConfiguration = new AsyncContinuationConfiguration();

            if (outgoingTransitions.Count == 0)
            {
                targetConfiguration.AtomicOperation = org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperation_Fields.ACTIVITY_END.CanonicalName;
            }
            else
            {
                targetConfiguration.AtomicOperation = org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperation_Fields.TRANSITION_NOTIFY_LISTENER_TAKE.CanonicalName;

                if (outgoingTransitions.Count == 1)
                {
                    targetConfiguration.TransitionId = outgoingTransitions[0].Id;
                }
                else
                {
                    TransitionImpl matchingTargetTransition = null;
                    string         currentTransitionId      = currentConfiguration.TransitionId;
                    if (!string.ReferenceEquals(currentTransitionId, null))
                    {
                        matchingTargetTransition = targetActivity.findOutgoingTransition(currentTransitionId);
                    }

                    if (matchingTargetTransition != null)
                    {
                        targetConfiguration.TransitionId = matchingTargetTransition.Id;
                    }
                    else
                    {
                        // should not happen since it is avoided by validation
                        throw new ProcessEngineException("Cannot determine matching outgoing sequence flow");
                    }
                }
            }

            jobEntity.JobHandlerConfiguration = targetConfiguration;
        }