537 lines
20 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" id="Definitions_96f6665" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:process id="Process_1smb9b5" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_0bngcu2</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_0bngcu2" sourceRef="StartEvent_1" targetRef="Activity_10fbwgl" />
<bpmn:sequenceFlow id="Flow_0ggy7w4" sourceRef="Activity_10fbwgl" targetRef="Activity_0n8y9m7" />
<bpmn:manualTask id="Activity_0n8y9m7" name="About PEP8">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser># Readability
The creator of Python, Guido van Rossum, said
“Code is read much more often than its written.” It is worth taking the time to create code that is easy to understand.
For this reason we recommend following a popular standard called [PEP8](https://realpython.com/python-pep8/)
Here are some highlights from the standard...
## Variables
### Formatting:
being consistent in the naming of your variables makes them far easier to remember. If you always use lower case and separate words with underscores, you don't have to try and remember the formatting, you just have to remember what it is called. If everyone follows this standard, then you can remember their variables easier as well ...
* my_name (GOOD)
* MyName (NO)
* myname (NO)
### Use Thoughtful names.
Avoid names that don't have meaning, or are cryptic. Try to use names that are descriptive and concise.
* first_name = "Abraham" (GOOD)
* x = "Abraham Lincoln" (AVOID)
* fn = "Abraham" (AVOID)
## Whitespace
* Use blank lines, sparingly, to show clear steps
A little white space can make your code more readable.
So can comments.
* "Sparse is better than dense" -- Zen of Python. Place spaces around operators and boolean operations most of the time. Though it can be good to break this rule when there are multiple expressions of different priority. Take the following example, where the second line is harder to read than the first.
```python
if x &lt; 5: # GOOD
if x&gt;5 and x&lt;10 : # GOOD
if x &gt; 5 and x &lt; 10: # NOT AS GOOD
```
## Use Comments Sparingly
A few carefully chosen words can help *IF it isn't apparent already.* Good variable names and well written code come first. Then add additional comments only if the information is not already apparent in the code.
## Closing Brackets and braces
We work with dictionaries a lot. So we recommend closing your braces and brackets with the first line to make it easy to tell when the dictionary definition is complete. For example:
```python
children = {
"Robert",
"Edward"
"Tad",
"Willie"
}
```
# “Simple is better than complex.”
* Don't compare booleans, it's not necessary
```python
is_bigger = 6 &gt; 5
if is_bigger: # GOOD
if is_bigger == True: # AVOID
```
* "is not" is easier to read:
```python
if not x is None: # AVOID
if x is not None: # GOOD
```
</spiffworkflow:instructionsForEndUser>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0ggy7w4</bpmn:incoming>
<bpmn:outgoing>Flow_1s0vaon</bpmn:outgoing>
</bpmn:manualTask>
<bpmn:endEvent id="Event_16l8zdp">
<bpmn:incoming>Flow_0dwam7u</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1s0vaon" sourceRef="Activity_0n8y9m7" targetRef="Activity_14uu3ah" />
<bpmn:sequenceFlow id="Flow_0x52gsc" sourceRef="Activity_14uu3ah" targetRef="Activity_1v40j82" />
<bpmn:scriptTask id="Activity_10fbwgl" name="Simple Script Task">
<bpmn:extensionElements>
<spiffworkflow:unitTests>
<spiffworkflow:unitTest id="Example Test">
<spiffworkflow:inputJson>{}</spiffworkflow:inputJson>
<spiffworkflow:expectedOutputJson>{
"age": 54,
"height": 1.93,
"children": [
"Robert",
"Edward",
"Tad",
"Willie"
],
"is_married": true,
"my_age": 55,
"cabinet": {
"Secretary of State": {
"name": "William H. Seward",
"age": 60,
"children": [
"William Jr.",
"Frederick",
"Augustus",
"Anna"
]
}
}
}</spiffworkflow:expectedOutputJson>
</spiffworkflow:unitTest>
</spiffworkflow:unitTests>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0bngcu2</bpmn:incoming>
<bpmn:outgoing>Flow_0ggy7w4</bpmn:outgoing>
<bpmn:dataOutputAssociation id="DataOutputAssociation_0bw1xmy">
<bpmn:targetRef>children</bpmn:targetRef>
</bpmn:dataOutputAssociation>
<bpmn:dataOutputAssociation id="DataOutputAssociation_0ixsxk4">
<bpmn:targetRef>DataObjectReference_0wac5go</bpmn:targetRef>
</bpmn:dataOutputAssociation>
<bpmn:script>
# Adding function
def add_one(input):
return input + 1
size = "medium"
# Creating Variables
age = 51 # This is an integer
height = 1.93 # This is a float or "floating point number"
children = ['Robert', 'Edward', 'Tad', 'Willie'] # This is a list
is_married = True # This is a boolean
# Updating Variables
Age = 50 # Variables are case sensitive, this is a new variable.
age = 54 # This updates the age variable.
# Referencing variables
my_age = age # my_age is now set to 54
my_age = add_one(my_age)
# Deleting variables
del(Age) # The age variable no longer exists. You will get an error if you try to use it.
# This is a dictionary, and you will use a lot of them...
cabinet = {
"Secretary of State": "William H. Seward",
"Secretary of the Treasury": "Salmon P. Chase",
"Secretary of War": "Edwin M. Stanton",
"Attorney General": "Edward Bates"
}
# Dictionaries can be deeply nested and contain any type of variable
cabinet = {
"Secretary of State": {
"name": "William H. Seward",
"age": 60,
"children": ['William Jr.', 'Frederick', 'Augustus', 'Anna']
}
}
</bpmn:script>
</bpmn:scriptTask>
<bpmn:userTask id="Activity_14uu3ah" name="Simple User Task">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser />
<spiffworkflow:properties>
<spiffworkflow:property name="formJsonSchemaFilename" value="simple-user-task-schema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="simple-user-task-uischema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1s0vaon</bpmn:incoming>
<bpmn:outgoing>Flow_0x52gsc</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="Flow_1hy1jl1" sourceRef="Activity_1v40j82" targetRef="Activity_1ct9c0w" />
<bpmn:serviceTask id="Activity_1v40j82" name="Simple Service Tasks">
<bpmn:extensionElements>
<spiffworkflow:serviceTaskOperator id="http/GetRequest" resultVariable="api_result">
<spiffworkflow:parameters>
<spiffworkflow:parameter id="url" type="str" value="&#34;https://dog.ceo/api/breeds/image/random&#34;" />
<spiffworkflow:parameter id="headers" type="any" />
<spiffworkflow:parameter id="params" type="any" />
<spiffworkflow:parameter id="basic_auth_username" type="str" />
<spiffworkflow:parameter id="basic_auth_password" type="str" />
</spiffworkflow:parameters>
</spiffworkflow:serviceTaskOperator>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0x52gsc</bpmn:incoming>
<bpmn:outgoing>Flow_1hy1jl1</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_19uhs80" sourceRef="Activity_1ct9c0w" targetRef="Activity_1urrvze" />
<bpmn:manualTask id="Activity_1ct9c0w" name="Simple Manual Task">
<bpmn:extensionElements>
<spiffworkflow:instructionsForEndUser>
# Our dog picture
![Dog]({{api_result["message"]}})
# List of Abe's Children:
{%- for child in children %}
* {{child}}
{% endfor -%}
# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
## Horizontal Rules
___
---
***
## Emphasis
**This is bold text**
__This is bold text__
*This is italic text*
_This is italic text_
~~Strikethrough~~
## Blockquotes
&gt; Blockquotes can also be nested...
&gt;&gt; ...by using additional greater-than signs right next to each other...
&gt; &gt; &gt; ...or with spaces between arrows.
## Lists
Unordered
+ Create a list by starting a line with `+`, `-`, or `*`
+ Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy!
Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
1. You can use sequential numbers...
1. ...or keep all the numbers as `1.`
Start numbering with offset:
57. foo
1. bar
## Code
Inline `code`
Indented code
// Some comments
line 1 of code
line 2 of code
line 3 of code
Block code "fences"
```
Sample text here...
```
Syntax highlighting
``` js
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
```
## Tables
| Option | Description |
| ------ | ----------- |
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |
Right aligned columns
| Option | Description |
| ------:| -----------:|
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |
## Links
[link text](http://dev.nodeca.com)
[link with title](http://nodeca.github.io/pica/demo/ "title text!")
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
## Images
![Minion](https://octodex.github.com/images/minion.png)
![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
Like links, Images also have a footnote style syntax
![Alt text][id]
With a reference later in the document defining the URL location:
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
### [Footnotes](https://github.com/markdown-it/markdown-it-footnote)
Footnote 1 link[^first].
Footnote 2 link[^second].
Inline footnote^[Text of inline footnote] definition.
Duplicated footnote reference[^second].
[^first]: Footnote **can have markup**
and multiple paragraphs.
[^second]: Footnote text.
### This is here
Because we wanted to show that footnotes end up at the very end of the page, not immediately below the footnote refernece.</spiffworkflow:instructionsForEndUser>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1hy1jl1</bpmn:incoming>
<bpmn:outgoing>Flow_19uhs80</bpmn:outgoing>
<bpmn:property id="Property_1biie0x" name="__targetRef_placeholder" />
<bpmn:dataInputAssociation id="DataInputAssociation_13dp3ns">
<bpmn:sourceRef>children</bpmn:sourceRef>
<bpmn:targetRef>Property_1biie0x</bpmn:targetRef>
</bpmn:dataInputAssociation>
<bpmn:dataInputAssociation id="DataInputAssociation_1atkomw">
<bpmn:sourceRef>DataObjectReference_0wac5go</bpmn:sourceRef>
<bpmn:targetRef>Property_1biie0x</bpmn:targetRef>
</bpmn:dataInputAssociation>
</bpmn:manualTask>
<bpmn:sequenceFlow id="Flow_0dwam7u" sourceRef="Activity_1urrvze" targetRef="Event_16l8zdp" />
<bpmn:businessRuleTask id="Activity_1urrvze" name="Simple Decision">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>decision_1</spiffworkflow:calledDecisionId>
</bpmn:extensionElements>
<bpmn:incoming>Flow_19uhs80</bpmn:incoming>
<bpmn:outgoing>Flow_0dwam7u</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:dataObjectReference id="childrenref" name="childrenref" dataObjectRef="children" />
<bpmn:dataObject id="children" name="children" />
<bpmn:dataObjectReference id="DataObjectReference_0wac5go" name="children" dataObjectRef="children" />
<bpmn:textAnnotation id="TextAnnotation_187nrj2">
<bpmn:text>The most straight forward way to create data is with a script task. Use the properties panel to the left, open the script section and launch the editor to see how we create variables.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_1p0ufnk" sourceRef="Activity_10fbwgl" targetRef="TextAnnotation_187nrj2" />
<bpmn:textAnnotation id="TextAnnotation_06zy8xo">
<bpmn:text>Forms are another way to collect data.  Note that we can reference "name" set in the first script task within the form to pre-populate fields.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_1y0yapk" sourceRef="Activity_14uu3ah" targetRef="TextAnnotation_06zy8xo" />
<bpmn:textAnnotation id="TextAnnotation_1xr1sng">
<bpmn:text>You can also create data with a Service Task - here we reach out to a free API on the internet to get a random dog picture.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_0nua6mt" sourceRef="Activity_1v40j82" targetRef="TextAnnotation_1xr1sng" />
<bpmn:textAnnotation id="TextAnnotation_1xfcrfr">
<bpmn:text>Manual tasks allow us to display data.  In this example we display the image we collected in the previous step.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_110zoau" sourceRef="Activity_1ct9c0w" targetRef="TextAnnotation_1xfcrfr" />
<bpmn:textAnnotation id="TextAnnotation_0emfhha">
<bpmn:text>Decision Tables like this one allow us to reference the data we've collected to create new variables.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_1r6p9kj" sourceRef="Activity_1urrvze" targetRef="TextAnnotation_0emfhha" />
<bpmn:textAnnotation id="TextAnnotation_124kdnx">
<bpmn:text>Data Stores are a special form of data that behaves differently than normal data.  You can control which tasks can see it, which can write to it.  It is never copied to the next task - only one copy ever exists, which causes it to behave differently in parallel tasks.</bpmn:text>
</bpmn:textAnnotation>
<bpmn:association id="Association_1218642" sourceRef="children" targetRef="TextAnnotation_124kdnx" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1smb9b5">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="142" y="12" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0ip5gqo_di" bpmnElement="Activity_0n8y9m7">
<dc:Bounds x="370" y="-10" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_16l8zdp_di" bpmnElement="Event_16l8zdp">
<dc:Bounds x="1142" y="12" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_079whp1_di" bpmnElement="Activity_10fbwgl">
<dc:Bounds x="230" y="-10" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_02lcq5d_di" bpmnElement="Activity_14uu3ah">
<dc:Bounds x="520" y="-10" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0dju85j_di" bpmnElement="Activity_1v40j82">
<dc:Bounds x="680" y="-10" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_071v8hv_di" bpmnElement="Activity_1ct9c0w">
<dc:Bounds x="830" y="-10" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0ibsyfq_di" bpmnElement="Activity_1urrvze">
<dc:Bounds x="980" y="-10" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_187nrj2_di" bpmnElement="TextAnnotation_187nrj2">
<dc:Bounds x="120" y="-210" width="240" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_06zy8xo_di" bpmnElement="TextAnnotation_06zy8xo">
<dc:Bounds x="360" y="-320" width="260" height="70" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_1xr1sng_di" bpmnElement="TextAnnotation_1xr1sng">
<dc:Bounds x="620" y="-190" width="280" height="50" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_1xfcrfr_di" bpmnElement="TextAnnotation_1xfcrfr">
<dc:Bounds x="960" y="150" width="230.00751138405442" height="55.242390078917694" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_0emfhha_di" bpmnElement="TextAnnotation_0emfhha">
<dc:Bounds x="950" y="-140" width="200.00001032161603" height="55.242390078917694" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="TextAnnotation_124kdnx_di" bpmnElement="TextAnnotation_124kdnx">
<dc:Bounds x="620" y="240" width="280" height="130" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0bngcu2_di" bpmnElement="Flow_0bngcu2">
<di:waypoint x="178" y="30" />
<di:waypoint x="230" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0ggy7w4_di" bpmnElement="Flow_0ggy7w4">
<di:waypoint x="330" y="30" />
<di:waypoint x="370" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1s0vaon_di" bpmnElement="Flow_1s0vaon">
<di:waypoint x="470" y="30" />
<di:waypoint x="520" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0x52gsc_di" bpmnElement="Flow_0x52gsc">
<di:waypoint x="620" y="30" />
<di:waypoint x="680" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1hy1jl1_di" bpmnElement="Flow_1hy1jl1">
<di:waypoint x="780" y="30" />
<di:waypoint x="830" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_19uhs80_di" bpmnElement="Flow_19uhs80">
<di:waypoint x="930" y="30" />
<di:waypoint x="980" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0dwam7u_di" bpmnElement="Flow_0dwam7u">
<di:waypoint x="1080" y="30" />
<di:waypoint x="1142" y="30" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_1p0ufnk_di" bpmnElement="Association_1p0ufnk">
<di:waypoint x="261" y="-10" />
<di:waypoint x="205" y="-130" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_1y0yapk_di" bpmnElement="Association_1y0yapk">
<di:waypoint x="564" y="-10" />
<di:waypoint x="528" y="-250" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_0nua6mt_di" bpmnElement="Association_0nua6mt">
<di:waypoint x="718" y="-10" />
<di:waypoint x="680" y="-140" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_110zoau_di" bpmnElement="Association_110zoau">
<di:waypoint x="919" y="70" />
<di:waypoint x="996" y="150" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Association_1r6p9kj_di" bpmnElement="Association_1r6p9kj">
<di:waypoint x="1022" y="-10" />
<di:waypoint x="1008" y="-85" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="DataObjectReference_0wac5go_di" bpmnElement="DataObjectReference_0wac5go">
<dc:Bounds x="582" y="153" width="36" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="581" y="210" width="39" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="DataOutputAssociation_0ixsxk4_di" bpmnElement="DataOutputAssociation_0ixsxk4">
<di:waypoint x="330" y="52" />
<di:waypoint x="582" y="164" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="DataInputAssociation_1atkomw_di" bpmnElement="DataInputAssociation_1atkomw">
<di:waypoint x="618" y="170" />
<di:waypoint x="856" y="70" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>