Skip to content

Commit b9ad244

Browse files
committed
Mostly minor edits
1 parent e284dd8 commit b9ad244

10 files changed

Lines changed: 112 additions & 85 deletions

File tree

doc/bpmn/advanced.rst

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BPMN Tasks have the following additional attributes.
1616

1717
* `bpmn_id`: the ID of the BPMN Task (this will be :code:`None` if the task is not visible on the diagram)
1818
* `bpmn_name`: the BPMN name of the Task
19-
* `lame`: the lane of the BPMN Task
19+
* `lane`: the lane of the BPMN Task
2020
* `documentation`: the contents of the BPMN `documentation` element for the Task
2121
* `data_input_associations`: a list of incoming data object references
2222
* `data_output_associtions`: a list of outgoing data object references
@@ -44,7 +44,7 @@ To retrieve a list of tasks associated with a particular task spec, use :code:`w
4444

4545
.. code:: python
4646
47-
tasks = workflow.get_tasks_from_spec_name('customize_product')
47+
tasks = workflow.get_tasks_from_spec_name('customize_product')
4848
4949
will return a list containing the Call Actitivities for the customization of a product in our example workflow.
5050

@@ -76,7 +76,7 @@ to create a list of all tasks. It is also possible to start from a particular s
7676

7777
.. code:: python
7878
79-
tasks = workflow.get_tasks_from_spec_name('customize_prodcut')
79+
tasks = workflow.get_tasks_from_spec_name('customize_product')
8080
subprocess = workflow.get_subprocess(tasks[0])
8181
subprocess_tasks = workflow.get_tasks(workflow=subprocess)
8282
@@ -126,11 +126,11 @@ See the example in :doc:`synthesis` for the basics of creating a parser. The pa
126126

127127
- a set of namespaces (useful if you have custom extensions)
128128
- a BPMN Validator (the one in the :code:`bpmn` package validates against the BPMN 2.0 spec)
129-
- a mapping of XML tag to Task Spec Descriptions. The default set of descriptions can be found in
129+
- a mapping of XML tag to Task Spec Descriptions. The default set of descriptions can be found in
130130
:code:`SpiffWorkflow.bpmn.parser.spec_descriptions`. These values will be added to the Task Spec in the `description` attribute
131131
and are intended as a user-friendly description of what the task is.
132132

133-
The :code:`BpmnValidator` can be used and extended independently of the parser as well; call :code:`validate` with
133+
The :code:`BpmnValidator` can be used and extended independently of the parser as well; call :code:`validate` with
134134
an :code:`lxml` parsed tree.
135135

136136
Loading BPMN Files
@@ -150,7 +150,7 @@ The following methods are available for discovering the names of processes and D
150150
- :code:`find_all_spec`: Returns a mapping of name -> :code:`BpmnWorkflowSpec` for all processes used in all files that have been
151151
provided to the parser at that point.
152152
- :code:`get_process_dependences`: Returns a list of process IDs referenced by the provided process ID
153-
- :code:`get_dmn_dependencies`: Returns a list of DMN IDs referenced byt he provided process ID
153+
- :code:`get_dmn_dependencies`: Returns a list of DMN IDs referenced by the provided process ID
154154

155155

156156
Serialization
@@ -171,7 +171,7 @@ Serializing Custom Objects
171171
In `Custom Script Engines`_ , we add some custom methods and objects to our scripting environment. We create a simple
172172
class (a :code:`namedtuple`) that holds the product information for each product.
173173

174-
We'd like to be ble to save and restore our custom object.
174+
We'd like to be able to save and restore our custom object.
175175

176176
.. code:: python
177177
@@ -398,7 +398,7 @@ that this could be a Docker container with a complex environment, an HTTP API ru
398398

399399
Note that our execute method returns :code:`True`. We could check the status of our process here and return
400400
:code:`False` to force our task into an `ERROR` state if the task failed to execute.
401-
401+
402402
We could also return :code:`None`
403403
if the task is not finished; this will cause the task to go into the `STARTED` state. You would have to manually
404404
complete a task that has been `STARTED`. The purpose of the state is to tell SpiffWorkflow your application will
@@ -410,19 +410,14 @@ that this could be a Docker container with a complex environment, an HTTP API ru
410410
Service Tasks
411411
-------------
412412

413-
Let's return to the simpler Custom Script Engine case, ignoring the possibility of running in some external environment.
414-
415-
Each of these functions takes a parameter, and if you expect BPMN authors to use them, it's necessary to let them know
416-
the functions exist, as well as how to call them. This is a little inconvenient, so an alternative would be to
417-
re-implement them as Service Tasks.
418-
419413
Service Tasks are also executed by the workflow's script engine, but through a different method, with the help of some
420414
custom extensions in the :code:`spiff` package:
421415

422416
- `operation_name`, the name assigned to the service being called
423417
- `operation_params`, the parameters the operation requires
424418

425-
This is our script engine and scripting enviroment:
419+
420+
This is our script engine and scripting environment:
426421

427422
.. code:: python
428423
@@ -449,7 +444,7 @@ This is our script engine and scripting enviroment:
449444
service_task_engine = ServiceTaskEngine()
450445
451446
Instead of adding our custom functions to the enviroment, we'll override :code:`call_service` and call them directly
452-
according to the `operation_name` that was given. The :code:`spiff` Service Task also evaluates the parameters
447+
according to the `operation_name` that was given. The :code:`spiff` Service Task also evaluates the parameters
453448
against the task data for us, so we can pass those in directly. The Service Task will also store our result in
454449
a user-specified variable.
455450

@@ -483,8 +478,8 @@ Our `modeler <https://github.com/sartography/bpmn-js-spiffworkflow>`_ has a mean
483478
their parameters that can be displayed to a BPMN author in the Service Task configurtion panel. There is an example of
484479
hard-coding a list of services in
485480
`app.js <https://github.com/sartography/bpmn-js-spiffworkflow/blob/0a9db509a0e85aa7adecc8301d8fbca9db75ac7c/app/app.js#L47>`_
486-
and as suggested, it would be reasonably straightforward to replace this with a API call. SpiffArena has robust
487-
mechanisms for handling this that might serve as a model for you.
481+
and as suggested, it would be reasonably straightforward to replace this with a API call. `SpiffArena <https://www.spiffworkflow.org/posts/articles/get_started/>`_
482+
has robust mechanisms for handling this that might serve as a model for you.
488483

489484
How this all works is obviously heavily dependent on your application, so we won't go into further detail here, except
490485
to give you a bare bones starting point for implementing something yourself that meets your own needs.

doc/bpmn/camunda/support.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
Camunda Editor Support
22
======================
33

4+
.. warning:: There is a better way ...
5+
SpiffWorkflow does not aim to support all of Camunda's proprietary extensions.
6+
Many of of the items in the Camunda Properties Panel do not work. And
7+
major features of SpiffWorkflow (Messages, Data Objects, Service Tasks, Pre-Scripts, etc...)
8+
can not be configured in the Camunda editor. Use `SpiffArena <https://www.spiffworkflow.org/posts/articles/get_started/>`_
9+
to build and test your BPMN models instead!
10+
411
Earlier users of SpiffWorkflow relied heavily on Camunda's modeler and several of our task spec
512
implementations were based on Camunda's extensions. Support for these extensions has been moved
6-
to the :code:`camunda` package. We are not actively maintainin this package (though we will
7-
accept contriibutions from Camunda users!).
13+
to the :code:`camunda` package. We are not actively maintaining this package (though we will
14+
accept contributions from Camunda users!). Please be aware that many of the Camunda extensions
15+
that will appear in the Camunda editor do not work with SpiffWorkflow.
16+
817

918
.. toctree::
1019
:maxdepth: 3
1120

1221
tasks
1322
events
14-
multiinstance
23+
multiinstance

doc/bpmn/data.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We'll be using the following files from `spiff-example-cli <https://github.com/s
1616
Data Objects
1717
^^^^^^^^^^^^
1818

19-
Data Objects exist at a process level and are not visible in the diagram, but when you create a Data Object
19+
Data Objects exist at the process level and are not visible in the diagram, but when you create a Data Object
2020
Reference, you can choose what Data Object it points to.
2121

2222
.. figure:: figures/data/data_object_configuration.png
@@ -61,17 +61,16 @@ If you have set up our example repository, this model can be run with the follow
6161
Data Inputs and Outputs
6262
^^^^^^^^^^^^^^^^^^^^^^^
6363

64-
In complex workflows, it useful to be able to specify required Data Inputs and Outputs, especially for Call Activities
64+
In complex workflows, it is useful to be able to specify required Data Inputs and Outputs, especially for Call Activities
6565
given that they are external and might be shared across many different processes.
6666

6767
When you add a Data Input to a Call Activity, SpiffWorkflow will check that a variable with that name is available to
68-
be copied into the activity and copy *only* the variables you've specified as inputs. When you add a Data Output,
68+
be copied into the activity and copy *only* the variables you've specified as inputs. When you add a Data Output,
6969
SpiffWorkflow will copy *only* the variables you've specified from the Call Activity at the end of the process. If any
7070
of the variables are missing, SpiffWorkflow will raise an error.
7171

7272
Our product customization Call Activity does not require any input, but the output of the process is the product
7373
name and quantity. We can add corresponding Data Outputs for those.
74-
7574
.. figure:: figures/data/data_output.png
7675
:scale: 30%
7776
:align: center

doc/bpmn/events.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ In BPMN, Messages are used to communicate across processes. Technically, Messag
220220
intended to be used inside a single Process, but Spiff does support this use.
221221

222222
Messages are similar to Signals, in that they are referenced by name, but they have the
223-
additional property that they may contain a payload. The payload is a bit of python code that will be
224-
evaluated against the task data and sent along with the Message. In the corresponding Message Catch
223+
additional property that they may contain a payload. The payload is a bit of python code that will be
224+
evaluated against the task data and sent along with the Message. In the corresponding Message Catch
225225
Event or Receive Task, we define a variable name where we'll store the result.
226226

227-
We've added a QA process to our model, which will be initiated whenever an order takes to long
227+
We've added a QA process to our model, which will be initiated whenever an order takes too long
228228
to fulfill. We'll send the reason for the delay in the Message.
229229

230230
Spiff Messages can also optionally use Correlation Keys. The Correlation Key is an expression or set of
@@ -276,4 +276,4 @@ Running The Model
276276
.. note::
277277

278278
We're specifying a collaboration rather than a process so that SpiffWorkflow knows that there is more than
279-
one top-level process.
279+
one top-level process.

doc/bpmn/intro.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ BPMN Workflows
33

44
The basic idea of SpiffWorkflow is that you can use it to write an interpreter
55
in Python that creates business applications from BPMN models. In this section,
6-
we'll develop a model of a reasonably complex process and as well as a
7-
simple workflow runner.
6+
we'll develop a model of a reasonably complex process and show how to run it.
87

98
We expect that readers will fall into two general categories:
109

1110
- People with a background in BPMN who might not be very familiar Python
1211
- Python developers who might not know much about BPMN
1312

1413
This section of the documentation provides an example that (hopefully) serves
15-
the needs of both groups. We will introduce the BPMN elements that SpiffWorkflow
16-
supports and show how to build a simple workflow runner around them.
14+
the needs of both groups. We will introduce some of the more common BPMN
15+
elements and show how to build a simple workflow runner around them.
1716

1817
SpiffWorkflow does heavy-lifting such as keeping track of task dependencies and
1918
states and providing the ability to serialize or deserialize a workflow that
@@ -34,21 +33,21 @@ command:
3433

3534
.. code-block:: console
3635
37-
./spiff-bpmn-runner.py -c order_collboration \
36+
./spiff-bpmn-runner.py -c order_collaboration \
3837
-d bpmn/tutorial/{product_prices,shipping_costs}.dmn \
3938
-b bpmn/tutorial/{top_level_multi,call_activity_multi}.bpmn
4039
40+
.. sidebar:: BPMN Runner
4141

42-
For a full description of program options:
42+
The example app provides a utility for running BPMN Diagrams from the command
43+
line that will allow you to introspect a bit on a running process. You
44+
can see the options available by running:
4345

44-
.. code-block:: console
45-
46-
./spiff-bpmn-runner.py --help
46+
./spiff-bpmn-runner.py --help
4747

4848
The code in the workflow runner and the models in the bpmn directory of the
4949
repository will be discussed in the remainder of this tutorial.
5050

51-
The examples have primarily
5251

5352
Supported BPMN Elements
5453
-----------------------

doc/bpmn/overview.rst

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,30 @@ processes. BPMN links the realms of business and IT, and creates a common proces
1919
can be shared between the two.
2020

2121
BPMN describes details of process behaviors efficiently in a diagram. The meaning is precise enough
22-
to describe the technical details that control process execution in an automation engine.
22+
to describe the technical details that control process execution in an automation engine.
2323
SpiffWorkflow allows you to create code to directly execute a BPMN diagram.
2424

2525
When using SpiffWorkflow, a client can manipulate the BPMN diagram and still have their product work
2626
without a need for you to edit the Python code, improving response and turnaround time.
2727

2828
.. sidebar:: BPMN Modelers
2929

30-
There are a number of modelers in existence, and any BPMN compliant modeler should work.
31-
SpiffWorkflow has some basic support for the free Camunda modeler, in particular, its
32-
form building capabilities.
3330

34-
Our `modeler <https://github.com/sartography/bpmn-js-spiffworkflow>`_ provides several,
35-
extensions, including form specifications via JSON Schema.
31+
Currently the best way to build BPMN diagrams is through our SpiffArena project
32+
which provides a custom BPMN Modeler, along with ways to test and run BPMN diagrams
33+
from within a web browser. Please see our `getting started guide <https://www.spiffworkflow.org/posts/articles/get_started/>`_
34+
for more information.
35+
36+
It is also possible to use version 7 of the Camunda Modeler to create BPMN diagrams.
37+
However, be cautious of the properies panel settings, as many of these settings are
38+
not a part of the BPMN Standard, and are not handled in the same way within SpiffWorkflow.
39+
You can download the Camunda Modeler from `Camunda <https://camunda.com/download/modeler/>`_.
3640

3741
Today, nearly every process modeling tool supports BPMN in some fashion making it a great tool to
38-
learn and use. This page provides a brief overview, and the following section provides a more
42+
learn and use. This page provides a brief overview, and the following section provides a more
3943
in-depth look. There are many resources for additional information about BPMN.
4044

41-
Most of the examples in this guide have been created with
45+
Most of the examples in this guide have been created with
4246
`our modeler <https://github.com/sartography/bpmn-js-spiffworkflow>`_, which is based on
4347
`bpmn.js <https://bpmn.io/toolkit/bpmn-js/>`_.
4448

@@ -83,17 +87,25 @@ the other based on some data condition. BPMN has other gateway types.
8387
The important point is that we can use a gateway to add a branch in the
8488
workflow **without** creating an explicit branch in our Python code.
8589

86-
Events
90+
An Even More Complicated Workflow
8791
------
92+
BPMN is a rich language that can describe many different types of processes. In
93+
the following pages we'll cover lanes (a way to distribute work across different
94+
roles) events (a way to handle asynchronous events), multi-instance tasks (that
95+
can be executed many times in parallel or in sequence) and decomposition (the
96+
many ways you can interconnect diagrams to build larger more complex processes)
97+
We are just scratching the surface. For now let's take one more step and look
98+
at what Events make possible.
8899

100+
Events
101+
^^^^^^^
89102
In the above simple workflows, all of the transitions are deterministic and we
90103
have direct connections between tasks. We need to handle the cases where an event
91-
may or may not happen and link these events in different parts of the workflow or
104+
may or may not happen, and link these events in different parts of the workflow or
92105
across different workflows.
93106

94-
BPMN has a comprehensive suite of event elements that can used for this purpose.
95-
SpiffWorkflow does not support every single BPMN event type, but it can handle
96-
many of them.
107+
BPMN has a comprehensive suite of event elements. SpiffWorkflow does not support
108+
every single BPMN event type, but it can handle many of them.
97109

98110
.. figure:: figures/overview/events.png
99111
:scale: 25%
@@ -102,7 +114,7 @@ many of them.
102114
A workflow containing events
103115

104116

105-
We've already seen plain Start and End Events. BPMN also include the concepts
117+
We've already seen plain Start and End Events. BPMN also includes the concept
106118
of Intermediate Events (standalone events that may be Throwing or Catching) as well
107119
as Boundary Events (which are exclusively Catching).
108120

0 commit comments

Comments
 (0)