Exemple #1
0
 def accept_message(self, message):
     """
     Indicate to the workflow that a message has been received. The message will be processed
     by any waiting Intermediate or Boundary Message Events, that are waiting for the message.
     """
     assert not self.read_only
     self.refresh_waiting_tasks()
     self.do_engine_steps()
     for my_task in Task.Iterator(self.task_tree, Task.WAITING):
         my_task.task_spec.accept_message(my_task, message)
Exemple #2
0
 def _branch_is_complete(self, my_task):
     # Determine whether that branch is now completed by checking whether
     # it has any waiting items other than myself in it.
     skip = None
     for task in Task.Iterator(my_task, my_task.NOT_FINISHED_MASK):
         # If the current task is a child of myself, ignore it.
         if skip is not None and task._is_descendant_of(skip):
             continue
         if task.task_spec == self:
             skip = task
             continue
         return False
     return True