User: dan@sartography.com clicked save for examples/1-basic-concepts/understanding-data-part-1/python.bpmn
This commit is contained in:
parent
b1b5508307
commit
a7d6333571
|
@ -5,46 +5,6 @@
|
|||
<bpmn:outgoing>Flow_0bngcu2</bpmn:outgoing>
|
||||
</bpmn:startEvent>
|
||||
<bpmn:sequenceFlow id="Flow_0bngcu2" sourceRef="StartEvent_1" targetRef="Activity_10fbwgl" />
|
||||
<bpmn:scriptTask id="Activity_10fbwgl" name="Simple Script Task">
|
||||
<bpmn:incoming>Flow_0bngcu2</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0ggy7w4</bpmn:outgoing>
|
||||
<bpmn:script>
|
||||
# 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
|
||||
|
||||
# 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:sequenceFlow id="Flow_0ggy7w4" sourceRef="Activity_10fbwgl" targetRef="Activity_0n8y9m7" />
|
||||
<bpmn:manualTask id="Activity_0n8y9m7" name="About PEP8">
|
||||
<bpmn:extensionElements>
|
||||
|
@ -125,9 +85,97 @@ if x is not None: # GOOD
|
|||
<bpmn:outgoing>Flow_1s0vaon</bpmn:outgoing>
|
||||
</bpmn:manualTask>
|
||||
<bpmn:endEvent id="Event_16l8zdp">
|
||||
<bpmn:incoming>Flow_1s0vaon</bpmn:incoming>
|
||||
<bpmn:incoming>Flow_0x52gsc</bpmn:incoming>
|
||||
</bpmn:endEvent>
|
||||
<bpmn:sequenceFlow id="Flow_1s0vaon" sourceRef="Activity_0n8y9m7" targetRef="Event_16l8zdp" />
|
||||
<bpmn:sequenceFlow id="Flow_1s0vaon" sourceRef="Activity_0n8y9m7" targetRef="Activity_14uu3ah" />
|
||||
<bpmn:sequenceFlow id="Flow_0x52gsc" sourceRef="Activity_14uu3ah" targetRef="Event_16l8zdp" />
|
||||
<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:script>
|
||||
# Adding function
|
||||
def add_one(input):
|
||||
return input + 1
|
||||
|
||||
# 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: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:process>
|
||||
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1smb9b5">
|
||||
|
@ -141,8 +189,12 @@ if x is not None: # GOOD
|
|||
<dc:Bounds x="390" y="-10" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_02lcq5d_di" bpmnElement="Activity_14uu3ah">
|
||||
<dc:Bounds x="540" y="-10" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Event_16l8zdp_di" bpmnElement="Event_16l8zdp">
|
||||
<dc:Bounds x="552" y="12" width="36" height="36" />
|
||||
<dc:Bounds x="802" y="12" width="36" height="36" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNEdge id="Flow_0bngcu2_di" bpmnElement="Flow_0bngcu2">
|
||||
<di:waypoint x="178" y="30" />
|
||||
|
@ -154,7 +206,11 @@ if x is not None: # GOOD
|
|||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_1s0vaon_di" bpmnElement="Flow_1s0vaon">
|
||||
<di:waypoint x="490" y="30" />
|
||||
<di:waypoint x="552" y="30" />
|
||||
<di:waypoint x="540" y="30" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0x52gsc_di" bpmnElement="Flow_0x52gsc">
|
||||
<di:waypoint x="640" y="30" />
|
||||
<di:waypoint x="802" y="30" />
|
||||
</bpmndi:BPMNEdge>
|
||||
</bpmndi:BPMNPlane>
|
||||
</bpmndi:BPMNDiagram>
|
||||
|
|
Loading…
Reference in New Issue