Skip to content

Commit

Permalink
Merge pull request #78 from demostenes/bpmn_fixes
Browse files Browse the repository at this point in the history
Fixed parsing of cancelActivity in BoundaryEventParser
  • Loading branch information
knipknap committed Jan 17, 2018
2 parents e0aa0ab + 08d9fcd commit 2b3ada4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion SpiffWorkflow/bpmn/parser/task_parsers.py
Expand Up @@ -245,8 +245,9 @@ class BoundaryEventParser(IntermediateCatchEventParser):

def create_task(self):
event_definition = self.get_event_definition()
# BPMN spec states that cancelActivity is True by default
cancel_activity = self.node.get(
'cancelActivity', default='false').lower() == 'true'
'cancelActivity', default='true').lower() == 'true'
return self.spec_class(self.spec, self.get_task_spec_name(),
cancel_activity=cancel_activity,
event_definition=event_definition,
Expand Down
5 changes: 4 additions & 1 deletion SpiffWorkflow/bpmn/serializer/CompactWorkflowSerializer.py
Expand Up @@ -31,6 +31,9 @@
from ..workflow import BpmnWorkflow


LOG = logging.getLogger(__name__)


class UnrecoverableWorkflowChange(Exception):
"""
This is thrown if the workflow cannot be restored because the workflow spec
Expand Down Expand Up @@ -158,7 +161,7 @@ def recursive_dump(route_node, indent, verbose=False):
def go(self, workflow):
leaf_tasks = []
self._go(workflow.task_tree.children[0], self.route, leaf_tasks)
logging.debug('Leaf tasks after load, before _update: %s', leaf_tasks)
LOG.debug('Leaf tasks after load, before _update: %s', leaf_tasks)
for task in sorted(
leaf_tasks,
key=lambda t: 0 if getattr(
Expand Down
5 changes: 4 additions & 1 deletion SpiffWorkflow/bpmn/specs/BpmnProcessSpec.py
Expand Up @@ -24,6 +24,9 @@
import xml.etree.ElementTree as ET


LOG = logging.getLogger(__name__)


class _EndJoin(UnstructuredJoin):

def _check_threshold_unstructured(self, my_task, force=False):
Expand All @@ -48,7 +51,7 @@ def _check_threshold_unstructured(self, my_task, force=False):
waiting_tasks.append(task)

if len(waiting_tasks) == 0:
logging.debug(
LOG.debug(
'Endjoin Task ready: %s (ready/waiting tasks: %s)',
my_task,
list(my_task.workflow.get_tasks(Task.READY | Task.WAITING)))
Expand Down

0 comments on commit 2b3ada4

Please sign in to comment.