Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.vscode
.python-version
venv
.venv
docs/build
Expand Down
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ Set up virtual environment
python3 -m venv venv
source ./venv/bin/activate

Note: Some libraries included in requirements.txt only work in Python versions up to
and including 3.11. So if you run into troubles installing the required dependencies
(see below), you might want to consider using `pyenv <https://github.com/pyenv/pyenv>`
to install an additional version of Python on your system *before* creating the virtual
environment.

Install Requirements
--------------------

Expand Down Expand Up @@ -72,12 +78,5 @@ To run the curses application using serialized JSON files:

Select the 'Start Workflow' screen and start the process.

Run in docker
^^^^^^^^^^^^^

.. code:: bash

./bin/run_in_docker --help

## License
GNU LESSER GENERAL PUBLIC LICENSE
11 changes: 0 additions & 11 deletions bin/run_in_docker

This file was deleted.

8 changes: 1 addition & 7 deletions bpmn/tutorial/timer_start.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
<bpmn:startEvent id="Start_Event">
<bpmn:outgoing>Flow_032rj36</bpmn:outgoing>
<bpmn:timerEventDefinition id="TimerEventDefinition_0jgw0qx">
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">"PT1D"</bpmn:timeDuration>
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">"P1D"</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_0exxc43" sourceRef="Start_Event" targetRef="any_task" />
<bpmn:startEvent id="Start_Event">
<bpmn:outgoing>Flow_0exxc43</bpmn:outgoing>
<bpmn:timerEventDefinition id="TimerEventDefinition_0404tuj">
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">"PT1D"</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:startEvent>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="timer_start">
Expand Down
10 changes: 7 additions & 3 deletions spiff_example/misc/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ def _execute(self, my_task):
# The param also has a type, but I don't need it
params = dict((name, script_engine.evaluate(my_task, p['value'])) for name, p in self.operation_params.items())
try:
result = script_engine.call_service(self.operation_name, params, my_task.data)
my_task.data[self._result_variable(my_task)] = result
result = script_engine.call_service(
my_task,
operation_name=self.operation_name,
operation_params=params
)
my_task.data[self.result_variable] = result
return True
except FileNotFoundError as exc:
event_definition = ErrorEventDefinition('file_not_found', code='1')
Expand All @@ -52,7 +56,7 @@ def _execute(self, my_task):

class ServiceTaskEnvironment(TaskDataEnvironment):

def call_service(self, operation_name, operation_params, context):
def call_service(self, context, operation_name, operation_params):
if operation_name == 'read_file':
return open(operation_params['filename']).read()
else:
Expand Down
10 changes: 7 additions & 3 deletions spiff_example/misc/threaded_service_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def _execute(self, my_task):
script_engine = my_task.workflow.script_engine
params = dict((name, script_engine.evaluate(my_task, p['value'])) for name, p in self.operation_params.items())
try:
future = script_engine.call_service(self.operation_name, params, my_task.data)
future = script_engine.call_service(
my_task,
operation_name=self.operation_name,
operation_params=params
)
script_engine.environment.futures[future] = my_task
except Exception as exc:
raise WorkflowTaskException('Service Task execution error', task=my_task, exception=exc)
Expand All @@ -54,7 +58,7 @@ def __init__(self):
self.pool = ThreadPoolExecutor(max_workers=10)
self.futures = {}

def call_service(self, operation_name, operation_params, context):
def call_service(self, context, operation_name, operation_params):
if operation_name == 'wait':
seconds = randrange(1, 30)
return self.pool.submit(wait, seconds, operation_params['job_id'])
Expand All @@ -69,7 +73,7 @@ def update_completed_futures(self):
for future in finished:
task = futures.pop(future)
result = future.result()
task.data[task.task_spec._result_variable(task)] = result
task.data[task.task_spec.result_variable] = result
task.complete()

def run_ready_events(self):
Expand Down
2 changes: 1 addition & 1 deletion spiff_example/spiff/service_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self):
'datetime': datetime,
})

def call_service(self, operation_name, operation_params, task_data):
def call_service(self, task_data, operation_name, operation_params):
if operation_name == 'lookup_product_info':
product_info = lookup_product_info(operation_params['product_name']['value'])
result = product_info_to_dict(product_info)
Expand Down