Example #1
0
        protected internal virtual void handleEvent(VariableEvent @event)
        {
            AbstractVariableScope sourceScope = @event.SourceScope;

            if (sourceScope is ExecutionEntity)
            {
                addEventToScopeExecution((ExecutionEntity)sourceScope, @event);
            }
            else if (sourceScope is TaskEntity)
            {
                TaskEntity      task      = (TaskEntity)sourceScope;
                ExecutionEntity execution = task.getExecution();
                if (execution != null)
                {
                    addEventToScopeExecution(execution, @event);
                }
            }
            else if (sourceScope.ParentVariableScope is ExecutionEntity)
            {
                addEventToScopeExecution((ExecutionEntity)sourceScope.ParentVariableScope, @event);
            }
            else
            {
                throw new ProcessEngineException("BPMN execution scope expected");
            }
        }
Example #2
0
        public virtual TaskFormData createTaskForm(TaskEntity task)
        {
            TaskFormDataImpl taskFormData = new TaskFormDataImpl();

            Expression formKey = task.TaskDefinition.FormKey;

            if (formKey != null)
            {
                object formValue = formKey.getValue(task);
                if (formValue != null)
                {
                    taskFormData.FormKey = formValue.ToString();
                }
            }

            taskFormData.DeploymentId = deploymentId;
            taskFormData.Task         = task;
            initializeFormProperties(taskFormData, task.getExecution());
            initializeFormFields(taskFormData, task.getExecution());
            return(taskFormData);
        }
Example #3
0
        protected internal virtual string getActivityIdExceptionMessage(VariableScope variableScope)
        {
            string activityId          = null;
            string definitionIdMessage = "";

            if (variableScope is DelegateExecution)
            {
                activityId          = ((DelegateExecution)variableScope).CurrentActivityId;
                definitionIdMessage = " in the process definition with id '" + ((DelegateExecution)variableScope).ProcessDefinitionId + "'";
            }
            else if (variableScope is TaskEntity)
            {
                TaskEntity task = (TaskEntity)variableScope;
                if (task.getExecution() != null)
                {
                    activityId          = task.getExecution().ActivityId;
                    definitionIdMessage = " in the process definition with id '" + task.ProcessDefinitionId + "'";
                }
                if (task.getCaseExecution() != null)
                {
                    activityId          = task.getCaseExecution().ActivityId;
                    definitionIdMessage = " in the case definition with id '" + task.CaseDefinitionId + "'";
                }
            }
            else if (variableScope is DelegateCaseExecution)
            {
                activityId          = ((DelegateCaseExecution)variableScope).ActivityId;
                definitionIdMessage = " in the case definition with id '" + ((DelegateCaseExecution)variableScope).CaseDefinitionId + "'";
            }

            if (string.ReferenceEquals(activityId, null))
            {
                return("");
            }
            else
            {
                return(" while executing activity '" + activityId + "'" + definitionIdMessage);
            }
        }