Ejemplo 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);
        }
Ejemplo 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;
        }
Ejemplo 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;
        }
Ejemplo n.º 4
0
 public static void clear()
 {
     userTask      = null;
     modelInstance = null;
 }
Ejemplo n.º 5
0
 public virtual void notify(DelegateTask delegateTask)
 {
     modelInstance = delegateTask.BpmnModelInstance;
     userTask      = delegateTask.BpmnModelElementInstance;
 }
Ejemplo n.º 6
0
 public UserTaskBuilder(BpmnModelInstance modelInstance, UserTask element) : base(modelInstance, element, typeof(UserTaskBuilder))
 {
 }