Exemple #1
0
        // start /////////////////////////////////////////////////////////////////////

        protected internal override void performStart(CmmnActivityExecution execution)
        {
            CmmnActivity         activity        = execution.Activity;
            IList <CmmnActivity> childActivities = activity.Activities;

            if (childActivities != null && childActivities.Count > 0)
            {
                IList <CmmnExecution> children = execution.createChildExecutions(childActivities);
                execution.createSentryParts();
                execution.triggerChildExecutionsLifecycle(children);


                if (execution.Active)
                {
                    execution.fireIfOnlySentryParts();
                    // if "autoComplete == true" and there are no
                    // required nor active child activities,
                    // then the stage will be completed.
                    if (execution.Active)
                    {
                        checkAndCompleteCaseExecution(execution);
                    }
                }
            }
            else
            {
                execution.complete();
            }
        }
Exemple #2
0
        // repetition ///////////////////////////////////////////////////////////////

        public virtual void repeat(CmmnActivityExecution execution, string standardEvent)
        {
            CmmnActivity activity = execution.Activity;
            bool         repeat   = false;

            if (activity.EntryCriteria.Count == 0)
            {
                IList <string> events = activity.Properties.get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
                if (events != null && events.Contains(standardEvent))
                {
                    repeat = evaluateRepetitionRule(execution);
                }
            }
            else
            {
                if (ENABLE.Equals(standardEvent) || START.Equals(standardEvent) || OCCUR.Equals(standardEvent))
                {
                    repeat = evaluateRepetitionRule(execution);
                }
            }

            if (repeat)
            {
                CmmnActivityExecution parent = execution.Parent;

                // instantiate a new instance of given activity
                IList <CmmnExecution> children = parent.createChildExecutions(Arrays.asList(activity));
                // start the lifecycle of the new instance
                parent.triggerChildExecutionsLifecycle(children);
            }
        }