Esempio n. 1
0
        public static void addUserTaskCompensationHandler(BpmnModelInstance modelInstance, string boundaryEventId, string compensationHandlerId)
        {
            BoundaryEvent boundaryEvent = modelInstance.getModelElementById(boundaryEventId);
            BaseElement   scope         = (BaseElement)boundaryEvent.ParentElement;

            UserTask compensationHandler = modelInstance.newInstance(typeof(UserTask));

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

            Association association = modelInstance.newInstance(typeof(Association));

            association.AssociationDirection = AssociationDirection.One;
            association.Source = boundaryEvent;
            association.Target = compensationHandler;
            scope.addChildElement(association);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGenerateIdsOnCreate()
        public virtual void shouldGenerateIdsOnCreate()
        {
            BpmnModelInstance modelInstance = Bpmn.createEmptyModel();
            Definitions       definitions   = modelInstance.newInstance(typeof(Definitions));

            assertThat(definitions.Id).NotNull;

            Process process = modelInstance.newInstance(typeof(Process));

            assertThat(process.Id).NotNull;

            StartEvent startEvent = modelInstance.newInstance(typeof(StartEvent));

            assertThat(startEvent.Id).NotNull;

            UserTask userTask = modelInstance.newInstance(typeof(UserTask));

            assertThat(userTask.Id).NotNull;
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGenerateIdsOnRead()
        public virtual void shouldNotGenerateIdsOnRead()
        {
            BpmnModelInstance modelInstance = Bpmn.readModelFromStream(typeof(GenerateIdTest).getResourceAsStream("GenerateIdTest.bpmn"));
            Definitions       definitions   = modelInstance.Definitions;

            assertThat(definitions.Id).Null;

            Process process = modelInstance.getModelElementsByType(typeof(Process)).GetEnumerator().next();

            assertThat(process.Id).Null;

            StartEvent startEvent = modelInstance.getModelElementsByType(typeof(StartEvent)).GetEnumerator().next();

            assertThat(startEvent.Id).Null;

            UserTask userTask = modelInstance.getModelElementsByType(typeof(UserTask)).GetEnumerator().next();

            assertThat(userTask.Id).Null;
        }
Esempio n. 4
0
 public static void clear()
 {
     userTask      = null;
     modelInstance = null;
 }
Esempio n. 5
0
 public virtual void notify(DelegateTask delegateTask)
 {
     modelInstance = delegateTask.BpmnModelInstance;
     userTask      = delegateTask.BpmnModelElementInstance;
 }
Esempio n. 6
0
 public UserTaskBuilder(BpmnModelInstance modelInstance, UserTask element) : base(modelInstance, element, typeof(UserTaskBuilder))
 {
 }