Пример #1
0
        /// <summary>
        ///
        /// </summary>
        protected internal virtual void EnsureRootProcessInstanceInitialized()
        {
            var ctx = Context.CommandContext;

            if (rootProcessInstanceId == null && ctx != null)
            {
                rootProcessInstance = ctx.ExecutionEntityManager.FindById <ExecutionEntityImpl>(rootProcessInstanceId);
            }
        }
Пример #2
0
        /// <summary>
        /// Static factory method: to be used when a new execution is created for the very first time/
        /// Calling this will make sure no extra db fetches are needed later on, as all collections
        /// will be populated with empty collections. If they would be null, it would trigger
        /// a database fetch for those relationship entities.
        /// </summary>
        public static ExecutionEntityImpl CreateWithEmptyRelationshipCollections()
        {
            ExecutionEntityImpl execution = new ExecutionEntityImpl
            {
                executions        = new List <IExecutionEntity>(1),
                tasks             = new List <ITaskEntity>(1),
                variableInstances = new Dictionary <string, IVariableInstanceEntity>(1),
                jobs               = new List <IJobEntity>(1),
                timerJobs          = new List <ITimerJobEntity>(1),
                eventSubscriptions = new List <IEventSubscriptionEntity>(1),
                identityLinks      = new List <IIdentityLinkEntity>(1)
            };

            return(execution);
        }