mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-17 13:41:41 +00:00
1bed0fb3ee
cd4da465 Merge pull request #264 from sartography/bugfix/dmn-equality-with-boolean 414a59eb disambiguate DMN expressions eea53c91 Merge pull request #263 from sartography/feature/cleanup-task-completion d248d5b1 execute postscript before other complete hook tasks c09f1a90 streamline predict & remove some duplicated calls to it 64c21791 remove duplicate calls to update 4ca1076d move task update to _on_complete to ensure data is copied consistently after task related activities are done d037a7eb small changes for readability 025bc30f Quick patch -- is_executable needs to be accurate immediately. 14d3d8c3 Merge pull request #262 from sartography/feature/parser_info_features 849c223e We are jumping through a lot of complex xml parsing in SpiffWorkflow-Backend because we need to know some basic information about a BPMN process at the moment it is saved. Rather than do that work in the backend, it seems better to have SpiffWorkflow handle parsing the xml and providing a bit of metadata, including: git-subtree-dir: SpiffWorkflow git-subtree-split: cd4da465e125ca1ae1b57d227bfa324d9d4c507c
43 lines
1.8 KiB
Python
43 lines
1.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
import os
|
|
|
|
from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer
|
|
from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser
|
|
from SpiffWorkflow.camunda.serializer.task_spec_converters import UserTaskConverter, StartEventConverter, EndEventConverter, \
|
|
IntermediateCatchEventConverter, IntermediateThrowEventConverter, BoundaryEventConverter
|
|
|
|
from SpiffWorkflow.dmn.serializer.task_spec_converters import BusinessRuleTaskConverter
|
|
|
|
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
|
|
|
|
|
|
__author__ = 'danfunk'
|
|
|
|
wf_spec_converter = BpmnWorkflowSerializer.configure_workflow_spec_converter([
|
|
UserTaskConverter, BusinessRuleTaskConverter, StartEventConverter,
|
|
EndEventConverter, BoundaryEventConverter, IntermediateCatchEventConverter,
|
|
IntermediateThrowEventConverter])
|
|
|
|
class BaseTestCase(BpmnWorkflowTestCase):
|
|
""" Provides some basic tools for loading up and parsing camunda BPMN files """
|
|
|
|
serializer = BpmnWorkflowSerializer(wf_spec_converter)
|
|
|
|
def get_parser(self, filename, dmn_filename=None):
|
|
f = os.path.join(os.path.dirname(__file__), 'data', filename)
|
|
parser = CamundaParser()
|
|
parser.add_bpmn_files_by_glob(f)
|
|
if dmn_filename is not None:
|
|
dmn = os.path.join(os.path.dirname(__file__), 'data', 'dmn', dmn_filename)
|
|
parser.add_dmn_files_by_glob(dmn)
|
|
return parser
|
|
|
|
def load_workflow_spec(self, filename, process_name, dmn_filename=None):
|
|
parser = self.get_parser(filename, dmn_filename)
|
|
top_level_spec = parser.get_spec(process_name)
|
|
subprocesses = parser.get_subprocess_specs(process_name)
|
|
return top_level_spec, subprocesses
|
|
|
|
def reload_save_restore(self):
|
|
self.save_restore()
|