protected internal override ITask CreateModelAccessTask(IBpmnModelInstance modelInstance, Type delegateClass)
        {
            IManualTask task = modelInstance.NewInstance <IManualTask>(typeof(IManualTask));

            task.Id = "manualTask";
            ICamundaExecutionListener executionListener = modelInstance.NewInstance <ICamundaExecutionListener>(typeof(ICamundaExecutionListener));

            executionListener.CamundaEvent = ExecutionListenerFields.EventNameStart;
            //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            executionListener.CamundaClass = delegateClass.FullName;
            task.Builder().AddExtensionElement(executionListener);
            return(task);
        }
        private void addMessageEventDefinition(ICatchEvent catchEvent)
        {
            IBpmnModelInstance modelInstance = (IBpmnModelInstance)catchEvent.ModelInstance;
            IMessage           message       = modelInstance.NewInstance <IMessage>(typeof(IMessage));

            message.Id   = MESSAGE_ID;
            message.Name = MESSAGE_NAME;
            modelInstance.Definitions.AddChildElement(message);
            IMessageEventDefinition messageEventDefinition = modelInstance.NewInstance <IMessageEventDefinition>(typeof(IMessageEventDefinition));

            messageEventDefinition.Message = message;
            catchEvent.EventDefinitions.Add(messageEventDefinition);
        }
Exemplo n.º 3
0
        protected internal override ESS.FW.Bpm.Model.Bpmn.instance.ITask CreateModelAccessTask(IBpmnModelInstance modelInstance,
                                                                                               Type delegateClass)
        {
            var task = modelInstance.NewInstance <IUserTask>(typeof(IUserTask));

            task.Id = "userTask";
            var executionListener = modelInstance.NewInstance <ICamundaTaskListener>(typeof(ICamundaTaskListener));

            executionListener.CamundaEvent += TaskListenerFields.EventnameCreate;

            executionListener.CamundaClass = delegateClass.FullName;
            task.Builder().AddExtensionElement(executionListener);
            return(task);
        }
        protected internal static void initEndEvent(IBpmnModelInstance modelInstance, string endEventId)
        {
            var endEvent            = modelInstance.GetModelElementById/*<IEndEvent>*/ (endEventId);
            var terminateDefinition =
                modelInstance.NewInstance <ITerminateEventDefinition>(typeof(ITerminateEventDefinition));

            endEvent.AddChildElement(terminateDefinition);
        }
        protected internal virtual void addAllIn(IBpmnModelInstance modelInstance,
                                                 CallActivityBuilder callActivityBuilder)
        {
            var camundaIn = modelInstance.NewInstance <ICamundaOut>(typeof(ICamundaOut));

            camundaIn.CamundaVariables = Permissions.All.ToString();
            callActivityBuilder.AddExtensionElement(camundaIn);
        }
Exemplo n.º 6
0
        protected internal static void makeCancelEvent(IBpmnModelInstance model, string eventId)
        {
            var element = model.GetModelElementById/*<IModelElementInstance>*/ (eventId) as IModelElementInstance;

            var eventDefinition = model.NewInstance <ICancelEventDefinition>(typeof(ICancelEventDefinition));

            element.AddChildElement(eventDefinition);
        }
Exemplo n.º 7
0
        protected internal override ITask CreateModelAccessTask(IBpmnModelInstance modelInstance, Type delegateClass)
        {
            var serviceTask = modelInstance.NewInstance <IServiceTask>(typeof(IServiceTask));

            serviceTask.Id           = "serviceTask";
            serviceTask.CamundaClass = delegateClass.FullName;
            return(serviceTask);
        }
Exemplo n.º 8
0
        public static void addUserTaskCompensationHandler(IBpmnModelInstance modelInstance, string boundaryEventId,
                                                          string compensationHandlerId)
        {
            var boundaryEvent = (IBoundaryEvent)modelInstance.GetModelElementById/*<IBoundaryEvent>*/ (boundaryEventId);
            var scope         = (IBaseElement)boundaryEvent.ParentElement;

            var compensationHandler = modelInstance.NewInstance <IUserTask>(typeof(IUserTask));

            compensationHandler.Id = compensationHandlerId;
            compensationHandler.ForCompensation = true;
            scope.AddChildElement(compensationHandler);

            var association = modelInstance.NewInstance <IAssociation>(typeof(IAssociation));

            association.AssociationDirection = AssociationDirection.One;
            association.Source = boundaryEvent;
            association.Target = compensationHandler;
            scope.AddChildElement(association);
        }
Exemplo n.º 9
0
        private void addServiceTaskCompensationHandler(IBpmnModelInstance modelInstance, string boundaryEventId, string compensationHandlerId)
        {
            IBoundaryEvent boundaryEvent = (IBoundaryEvent)modelInstance.GetModelElementById/*<IBoundaryEvent>*/ (boundaryEventId);
            IBaseElement   scope         = (IBaseElement)boundaryEvent.ParentElement;

            IServiceTask compensationHandler = modelInstance.NewInstance <IServiceTask>(typeof(IServiceTask));

            compensationHandler.Id = compensationHandlerId;
            compensationHandler.ForCompensation = true;
            //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.GetName method:
            compensationHandler.CamundaClass = typeof(IncreaseCurrentTimeServiceTask).FullName;
            scope.AddChildElement(compensationHandler);

            IAssociation association = modelInstance.NewInstance <IAssociation>(typeof(IAssociation));

            association.AssociationDirection = AssociationDirection.One;
            association.Source = boundaryEvent;
            association.Target = compensationHandler;
            scope.AddChildElement(association);
        }
Exemplo n.º 10
0
        protected internal static void addTaskListener(IBpmnModelInstance targetModel, string activityId, string @event,
                                                       string className)
        {
            var taskListener = targetModel.NewInstance <ICamundaTaskListener>(typeof(ICamundaTaskListener));

            taskListener.CamundaClass = className;
            taskListener.CamundaEvent = @event;

            var task = targetModel.GetModelElementById/*<IUserTask>*/ (activityId) as IUserTask;

            task.Builder()
            .AddExtensionElement(taskListener);
        }
Exemplo n.º 11
0
        public static IProcessBuilder CreateProcess()
        {
            IBpmnModelInstance modelInstance = Instance.DoCreateEmptyModel();
            IDefinitions       definitions   = modelInstance.NewInstance <IDefinitions>(typeof(IDefinitions));

            definitions.TargetNamespace = BpmnModelConstants.Bpmn20Ns;
            definitions.DomElement.RegisterNamespace("camunda", BpmnModelConstants.CamundaNs);
            modelInstance.Definitions = definitions;
            IProcess process = modelInstance.NewInstance <IProcess>(typeof(IProcess));

            definitions.AddChildElement(process);

            IBpmnDiagram bpmnDiagram = modelInstance.NewInstance <IBpmnDiagram>(typeof(IBpmnDiagram));

            IBpmnPlane bpmnPlane = modelInstance.NewInstance <IBpmnPlane>(typeof(IBpmnPlane));

            bpmnPlane.BpmnElement = process;

            bpmnDiagram.AddChildElement(bpmnPlane);
            definitions.AddChildElement(bpmnDiagram);

            return(process.Builder());
        }
Exemplo n.º 12
0
 public virtual T NewInstance <T>(Type type) where T : IModelElementInstance
 {
     return(modelInstance.NewInstance <T>(type));
 }