mirror of
https://github.com/sartography/sample-process-models.git
synced 2025-02-24 21:58:18 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
a12179d617
41
dan/dmn-error/test1.bpmn
Normal file
41
dan/dmn-error/test1.bpmn
Normal file
@ -0,0 +1,41 @@
|
||||
<?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="Proccess_lciuw8t" isExecutable="true">
|
||||
<bpmn:startEvent id="StartEvent_1">
|
||||
<bpmn:outgoing>Flow_1dklsvb</bpmn:outgoing>
|
||||
</bpmn:startEvent>
|
||||
<bpmn:sequenceFlow id="Flow_1dklsvb" sourceRef="StartEvent_1" targetRef="Activity_0u3187y" />
|
||||
<bpmn:endEvent id="Event_19pa6jx">
|
||||
<bpmn:incoming>Flow_0bvjrjo</bpmn:incoming>
|
||||
</bpmn:endEvent>
|
||||
<bpmn:sequenceFlow id="Flow_0bvjrjo" sourceRef="Activity_0u3187y" targetRef="Event_19pa6jx" />
|
||||
<bpmn:businessRuleTask id="Activity_0u3187y">
|
||||
<bpmn:extensionElements>
|
||||
<spiffworkflow:calledDecisionId>Check_Amount_Documentation_Submit_Invoice</spiffworkflow:calledDecisionId>
|
||||
</bpmn:extensionElements>
|
||||
<bpmn:incoming>Flow_1dklsvb</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0bvjrjo</bpmn:outgoing>
|
||||
</bpmn:businessRuleTask>
|
||||
</bpmn:process>
|
||||
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Proccess_lciuw8t">
|
||||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
||||
<dc:Bounds x="179" y="159" width="36" height="36" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Event_19pa6jx_di" bpmnElement="Event_19pa6jx">
|
||||
<dc:Bounds x="432" y="159" width="36" height="36" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_1bl5y18_di" bpmnElement="Activity_0u3187y">
|
||||
<dc:Bounds x="270" y="137" width="100" height="80" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNEdge id="Flow_1dklsvb_di" bpmnElement="Flow_1dklsvb">
|
||||
<di:waypoint x="215" y="177" />
|
||||
<di:waypoint x="270" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0bvjrjo_di" bpmnElement="Flow_0bvjrjo">
|
||||
<di:waypoint x="370" y="177" />
|
||||
<di:waypoint x="432" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
</bpmndi:BPMNPlane>
|
||||
</bpmndi:BPMNDiagram>
|
||||
</bpmn:definitions>
|
12
dan/dmn-error/workflow.json
Normal file
12
dan/dmn-error/workflow.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"description": "Testing DMN",
|
||||
"display_name": "DMN Error",
|
||||
"display_order": 0,
|
||||
"exception_notification_addresses": [],
|
||||
"fault_or_suspend_on_exception": "fault",
|
||||
"files": [],
|
||||
"id": "dan/dmn-error",
|
||||
"is_review": false,
|
||||
"primary_file_name": "test1.bpmn",
|
||||
"primary_process_id": "Proccess_lciuw8t"
|
||||
}
|
44
dan/dmn-error/x_to_y.dmn
Normal file
44
dan/dmn-error/x_to_y.dmn
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="Definitions_76910d7" name="DRD" namespace="http://camunda.org/schema/1.0/dmn">
|
||||
<decision id="Check_Amount_Documentation_Submit_Invoice" name="My Check Amount">
|
||||
<decisionTable id="decisionTable_1">
|
||||
<input id="input_1">
|
||||
<inputExpression id="inputExpression_1" typeRef="string">
|
||||
<text>x</text>
|
||||
</inputExpression>
|
||||
</input>
|
||||
<output id="output_1" name="y" typeRef="string" />
|
||||
<rule id="DecisionRule_14q2jwl">
|
||||
<inputEntry id="UnaryTests_0pynigj">
|
||||
<text>1</text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_10c6qh7">
|
||||
<text>1000</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1g8ep0n">
|
||||
<inputEntry id="UnaryTests_1lcnkwk">
|
||||
<text>2</text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_001g5xs">
|
||||
<text>3000</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_02gugra">
|
||||
<inputEntry id="UnaryTests_0h7h26u">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0p5mowl">
|
||||
<text>4000</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
</decisionTable>
|
||||
</decision>
|
||||
<dmndi:DMNDI>
|
||||
<dmndi:DMNDiagram id="DMNDiagram_1cykosu">
|
||||
<dmndi:DMNShape id="DMNShape_1dhfq2s" dmnElementRef="Check_Amount_Documentation_Submit_Invoice">
|
||||
<dc:Bounds height="80" width="180" x="157" y="151" />
|
||||
</dmndi:DMNShape>
|
||||
</dmndi:DMNDiagram>
|
||||
</dmndi:DMNDI>
|
||||
</definitions>
|
9
dan/process_group.json
Normal file
9
dan/process_group.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"admin": false,
|
||||
"description": "Dan's Tests",
|
||||
"display_name": "Dan",
|
||||
"display_order": 17,
|
||||
"id": "dan",
|
||||
"process_groups": [],
|
||||
"process_models": []
|
||||
}
|
152
dan/set-permissions/group_permissions.dmn
Normal file
152
dan/set-permissions/group_permissions.dmn
Normal file
@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:biodi="http://bpmn.io/schema/dmn/biodi/2.0" id="Definitions_76910d7" name="DRD" namespace="http://camunda.org/schema/1.0/dmn">
|
||||
<decision id="groups_to_permissions" name="Groups to Permissions">
|
||||
<decisionTable id="decisionTable_1" hitPolicy="COLLECT">
|
||||
<input id="input_1" biodi:width="150">
|
||||
<inputExpression id="inputExpression_1" typeRef="string">
|
||||
<text>"*"</text>
|
||||
</inputExpression>
|
||||
</input>
|
||||
<output id="OutputClause_14rq1xp" name="permission_groups" typeRef="string" />
|
||||
<output id="output_1" name="permissions" typeRef="string" biodi:width="279" />
|
||||
<output id="OutputClause_1d0f70s" name="permission_uris" typeRef="string" biodi:width="254" />
|
||||
<rule id="DecisionRule_13uhk78">
|
||||
<description>Admins have access to everything.</description>
|
||||
<inputEntry id="UnaryTests_1yb5tu4">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_00aw971">
|
||||
<text>"admin"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_1drtsn8">
|
||||
<text>["create", "read", "update", "delete"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_13n9min">
|
||||
<text>"/*"
|
||||
</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1p3ja8s">
|
||||
<description>Everybody can participate in tasks assigned to them.</description>
|
||||
<inputEntry id="UnaryTests_1caf9gr">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0o539xo">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_1t1q088">
|
||||
<text>["create", "read", "update", "delete"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_03yyzzb">
|
||||
<text>"/v1.0/tasks/*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_011nhuj">
|
||||
<description>Everybody can start any process</description>
|
||||
<inputEntry id="UnaryTests_0bk33z9">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0favwyg">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0xkcga9">
|
||||
<text>["read", "create"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0dduq04">
|
||||
<text>"/v1.0/processes"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1d1y93n">
|
||||
<inputEntry id="UnaryTests_0pyfbgs">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_1nn1cm7">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_19gxawg">
|
||||
<text>["read"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0ead5kn">
|
||||
<text>"/v1.0/process-groups/*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_00orvbh">
|
||||
<inputEntry id="UnaryTests_1qkh4o9">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0akr57l">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0fasac2">
|
||||
<text>["read"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_04330nx">
|
||||
<text>"/v1.0/process-models/*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_0hlqewx">
|
||||
<inputEntry id="UnaryTests_06logw4">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_05586xp">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_04srdlz">
|
||||
<text>["read"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0lvpbey">
|
||||
<text>"/v1.0/process-instances/*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1gvn0at">
|
||||
<inputEntry id="UnaryTests_1djl10a">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_1qgsa8y">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0l6pcm5">
|
||||
<text>["read"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_1mlgjd8">
|
||||
<text>"/v1.0/process-instances/reports/*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1ush1di">
|
||||
<inputEntry id="UnaryTests_0ajhuce">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0w3207v">
|
||||
<text>"education"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0mhnzp3">
|
||||
<text>["create", "read", "update", "delete"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0t37e9p">
|
||||
<text>"/v1.0/process-groups/education:*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_0kcffrp">
|
||||
<inputEntry id="UnaryTests_10ga6h2">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0ujmqk1">
|
||||
<text>"organization"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_09f42eh">
|
||||
<text>["create", "read", "update", "delete"]</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0edy3e8">
|
||||
<text>"/v1.0/process-groups/education:*"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
</decisionTable>
|
||||
</decision>
|
||||
<dmndi:DMNDI>
|
||||
<dmndi:DMNDiagram id="DMNDiagram_1cykosu">
|
||||
<dmndi:DMNShape id="DMNShape_1dhfq2s" dmnElementRef="groups_to_permissions">
|
||||
<dc:Bounds height="80" width="180" x="157" y="151" />
|
||||
</dmndi:DMNShape>
|
||||
</dmndi:DMNDiagram>
|
||||
</dmndi:DMNDI>
|
||||
</definitions>
|
279
dan/set-permissions/permissions.bpmn
Normal file
279
dan/set-permissions/permissions.bpmn
Normal file
@ -0,0 +1,279 @@
|
||||
<?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_81k3gh6" isExecutable="true">
|
||||
<bpmn:startEvent id="StartEvent_1">
|
||||
<bpmn:outgoing>Flow_04t49zv</bpmn:outgoing>
|
||||
</bpmn:startEvent>
|
||||
<bpmn:sequenceFlow id="Flow_04t49zv" sourceRef="StartEvent_1" targetRef="Activity_0fqwhd1" />
|
||||
<bpmn:endEvent id="Event_0yjnug4">
|
||||
<bpmn:incoming>Flow_0boz2xm</bpmn:incoming>
|
||||
</bpmn:endEvent>
|
||||
<bpmn:sequenceFlow id="Flow_0q5cs4y" sourceRef="Activity_0pdrn26" targetRef="Activity_1jexxm1" />
|
||||
<bpmn:businessRuleTask id="Activity_0fqwhd1" name="Determine Users Group">
|
||||
<bpmn:extensionElements>
|
||||
<spiffworkflow:calledDecisionId>users_to_groups</spiffworkflow:calledDecisionId>
|
||||
</bpmn:extensionElements>
|
||||
<bpmn:incoming>Flow_04t49zv</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_194nkr6</bpmn:outgoing>
|
||||
</bpmn:businessRuleTask>
|
||||
<bpmn:businessRuleTask id="Activity_0iom85m" name="Determine Permissions">
|
||||
<bpmn:extensionElements>
|
||||
<spiffworkflow:calledDecisionId>groups_to_permissions</spiffworkflow:calledDecisionId>
|
||||
</bpmn:extensionElements>
|
||||
<bpmn:incoming>Flow_194nkr6</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0hg2xwi</bpmn:outgoing>
|
||||
</bpmn:businessRuleTask>
|
||||
<bpmn:manualTask id="Activity_0pdrn26" name="Display Proposed Permissions">
|
||||
<bpmn:extensionElements>
|
||||
<spiffworkflow:instructionsForEndUser># Permission for each group
|
||||
When you select continue, the following permissions will be written to the database.
|
||||
|
||||
{% for group in group_info %}
|
||||
|
||||
---
|
||||
|
||||
## {{group['name']}} Group
|
||||
**Users in Group:**
|
||||
{% for user in group['users'] %}
|
||||
* {{ user }}
|
||||
{% endfor %}
|
||||
|
||||
**Permissions:**
|
||||
| Path | Allowed Actions |
|
||||
| ---------------| -------|
|
||||
{% for permission in group['permissions'] %}
|
||||
| {{permission['uri']}} | {{ permission['actions'] |join(', ') }} |
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
</spiffworkflow:instructionsForEndUser>
|
||||
</bpmn:extensionElements>
|
||||
<bpmn:incoming>Flow_0f4klqg</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0q5cs4y</bpmn:outgoing>
|
||||
</bpmn:manualTask>
|
||||
<bpmn:sequenceFlow id="Flow_194nkr6" sourceRef="Activity_0fqwhd1" targetRef="Activity_0iom85m" />
|
||||
<bpmn:sequenceFlow id="Flow_0hg2xwi" sourceRef="Activity_0iom85m" targetRef="Activity_0jt9kr1" />
|
||||
<bpmn:sequenceFlow id="Flow_132k5th" sourceRef="Activity_1jexxm1" targetRef="Activity_0ino532" />
|
||||
<bpmn:sequenceFlow id="Flow_0boz2xm" sourceRef="Activity_0ino532" targetRef="Event_0yjnug4" />
|
||||
<bpmn:scriptTask id="Activity_1jexxm1" name="Set Permissions">
|
||||
<bpmn:incoming>Flow_0q5cs4y</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_132k5th</bpmn:outgoing>
|
||||
<bpmn:script># clear_permissions() ## Clears all groups and permissions from the system. EXCEPT ...
|
||||
|
||||
for group in group_info:
|
||||
for user in group['users']:
|
||||
add_user_to_group(user, group['name'])
|
||||
for permission in group['permissions']:
|
||||
for crud_op in permission['actions']:
|
||||
add_permission(crud_op, permission['uri'], group['name'])
|
||||
|
||||
</bpmn:script>
|
||||
</bpmn:scriptTask>
|
||||
<bpmn:manualTask id="Activity_0ino532" name="Show Actual Permissions">
|
||||
<bpmn:incoming>Flow_132k5th</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0boz2xm</bpmn:outgoing>
|
||||
</bpmn:manualTask>
|
||||
<bpmn:sequenceFlow id="Flow_0f4klqg" sourceRef="Activity_0jt9kr1" targetRef="Activity_0pdrn26" />
|
||||
<bpmn:scriptTask id="Activity_0jt9kr1" name="merge lists">
|
||||
<bpmn:extensionElements>
|
||||
<spiffworkflow:unitTests>
|
||||
<spiffworkflow:unitTest id="Two Records Test">
|
||||
<spiffworkflow:inputJson>{
|
||||
"groups": [
|
||||
"Administrators"
|
||||
],
|
||||
"users": [
|
||||
"admin@spiffworkflow.org"
|
||||
],
|
||||
"permission_groups": [
|
||||
"Administrators"
|
||||
],
|
||||
"permission_uris": [
|
||||
"/*"
|
||||
],
|
||||
"permissions": [
|
||||
[
|
||||
"create",
|
||||
"read",
|
||||
"update",
|
||||
"delete"
|
||||
]
|
||||
]
|
||||
}</spiffworkflow:inputJson>
|
||||
<spiffworkflow:expectedOutputJson>{
|
||||
"group_info": [
|
||||
{
|
||||
"name":"Administrators",
|
||||
"permissions": [
|
||||
{"actions": [
|
||||
"create","read","update","delete"
|
||||
],
|
||||
"uri": "/*"
|
||||
}
|
||||
],
|
||||
"users": ["admin@spiffworkflow.org"]
|
||||
}
|
||||
]
|
||||
}</spiffworkflow:expectedOutputJson>
|
||||
</spiffworkflow:unitTest>
|
||||
<spiffworkflow:unitTest id="Second Test">
|
||||
<spiffworkflow:inputJson>{
|
||||
"groups": [
|
||||
"Administrators",
|
||||
"Everyone"
|
||||
],
|
||||
"users": [
|
||||
"admin@spiffworkflow.org",
|
||||
"*"
|
||||
],
|
||||
"permission_groups": [
|
||||
"Administrators",
|
||||
"Everyone"
|
||||
],
|
||||
"permission_uris": [
|
||||
"/*",
|
||||
"/*"
|
||||
],
|
||||
"permissions": [
|
||||
[
|
||||
"create",
|
||||
"read",
|
||||
"update",
|
||||
"delete"
|
||||
],
|
||||
[
|
||||
"read"
|
||||
]
|
||||
]
|
||||
}</spiffworkflow:inputJson>
|
||||
<spiffworkflow:expectedOutputJson>{
|
||||
"group_info": [
|
||||
{
|
||||
"name": "Administrators",
|
||||
"permissions": [
|
||||
{
|
||||
"actions": [
|
||||
"create",
|
||||
"read",
|
||||
"update",
|
||||
"delete"
|
||||
],
|
||||
"uri": "/*"
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
"admin@spiffworkflow.org"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Everyone",
|
||||
"permissions": [
|
||||
{
|
||||
"actions": [
|
||||
"read"
|
||||
],
|
||||
"uri": "/*"
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}</spiffworkflow:expectedOutputJson>
|
||||
</spiffworkflow:unitTest>
|
||||
</spiffworkflow:unitTests>
|
||||
</bpmn:extensionElements>
|
||||
<bpmn:incoming>Flow_0hg2xwi</bpmn:incoming>
|
||||
<bpmn:outgoing>Flow_0f4klqg</bpmn:outgoing>
|
||||
<bpmn:script>info_by_group = {}
|
||||
for i, group in enumerate(groups):
|
||||
if not group in info_by_group:
|
||||
info_by_group[group] = {"users":[], "permissions": []}
|
||||
info_by_group[group]["users"].append(users[i])
|
||||
|
||||
for i, group in enumerate(permission_groups):
|
||||
if not group in info_by_group:
|
||||
info_by_group[group] = {"users":[], "permissions": []}
|
||||
info_by_group[group]["permissions"].append(
|
||||
{"uri": permission_uris[i],
|
||||
"actions": permissions[i]}
|
||||
)
|
||||
group_info = []
|
||||
for group in info_by_group.keys():
|
||||
group_info.append({
|
||||
"name": group,
|
||||
"users": info_by_group[group]['users'],
|
||||
"permissions": info_by_group[group]['permissions']
|
||||
})
|
||||
del(info_by_group)
|
||||
del(group)
|
||||
del(i)
|
||||
del(groups)
|
||||
del(permissions)
|
||||
del(permission_groups)
|
||||
del(permission_uris)
|
||||
del(users)</bpmn:script>
|
||||
</bpmn:scriptTask>
|
||||
</bpmn:process>
|
||||
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
||||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_81k3gh6">
|
||||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
|
||||
<dc:Bounds x="179" y="159" width="36" height="36" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Event_0yjnug4_di" bpmnElement="Event_0yjnug4">
|
||||
<dc:Bounds x="1272" y="159" width="36" height="36" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_1afo4x3_di" bpmnElement="Activity_0fqwhd1">
|
||||
<dc:Bounds x="280" y="137" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_0e33fg2_di" bpmnElement="Activity_0iom85m">
|
||||
<dc:Bounds x="440" y="137" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_0x17g2k_di" bpmnElement="Activity_1jexxm1">
|
||||
<dc:Bounds x="940" y="137" width="100" height="80" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_1h17v78_di" bpmnElement="Activity_0ino532">
|
||||
<dc:Bounds x="1100" y="137" width="100" height="80" />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_0fj3k0v_di" bpmnElement="Activity_0jt9kr1">
|
||||
<dc:Bounds x="610" y="137" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNShape id="Activity_16w91n5_di" bpmnElement="Activity_0pdrn26">
|
||||
<dc:Bounds x="770" y="137" width="100" height="80" />
|
||||
<bpmndi:BPMNLabel />
|
||||
</bpmndi:BPMNShape>
|
||||
<bpmndi:BPMNEdge id="Flow_04t49zv_di" bpmnElement="Flow_04t49zv">
|
||||
<di:waypoint x="215" y="177" />
|
||||
<di:waypoint x="280" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0q5cs4y_di" bpmnElement="Flow_0q5cs4y">
|
||||
<di:waypoint x="870" y="177" />
|
||||
<di:waypoint x="940" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_194nkr6_di" bpmnElement="Flow_194nkr6">
|
||||
<di:waypoint x="380" y="177" />
|
||||
<di:waypoint x="440" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0hg2xwi_di" bpmnElement="Flow_0hg2xwi">
|
||||
<di:waypoint x="540" y="177" />
|
||||
<di:waypoint x="610" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_132k5th_di" bpmnElement="Flow_132k5th">
|
||||
<di:waypoint x="1040" y="177" />
|
||||
<di:waypoint x="1100" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0boz2xm_di" bpmnElement="Flow_0boz2xm">
|
||||
<di:waypoint x="1200" y="177" />
|
||||
<di:waypoint x="1272" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
<bpmndi:BPMNEdge id="Flow_0f4klqg_di" bpmnElement="Flow_0f4klqg">
|
||||
<di:waypoint x="710" y="177" />
|
||||
<di:waypoint x="770" y="177" />
|
||||
</bpmndi:BPMNEdge>
|
||||
</bpmndi:BPMNPlane>
|
||||
</bpmndi:BPMNDiagram>
|
||||
</bpmn:definitions>
|
11
dan/set-permissions/process_model.json
Normal file
11
dan/set-permissions/process_model.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"description": "Set up groups and permissions",
|
||||
"display_name": "Set Permissions",
|
||||
"display_order": 0,
|
||||
"exception_notification_addresses": [],
|
||||
"fault_or_suspend_on_exception": "fault",
|
||||
"files": [],
|
||||
"metadata_extraction_paths": null,
|
||||
"primary_file_name": "permissions.bpmn",
|
||||
"primary_process_id": "Process_81k3gh6"
|
||||
}
|
20
dan/set-permissions/select_user.json
Normal file
20
dan/set-permissions/select_user.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"title": "Select User",
|
||||
"description": "If the following user logged in ...",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user"
|
||||
],
|
||||
"properties": {
|
||||
"user": {
|
||||
"title": "Select a user from the dropdown list",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Nelson",
|
||||
"Malala",
|
||||
"Harriet",
|
||||
"Martin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
65
dan/set-permissions/users_to_groups.dmn
Normal file
65
dan/set-permissions/users_to_groups.dmn
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:biodi="http://bpmn.io/schema/dmn/biodi/2.0" id="Definitions_76910d7" name="DRD" namespace="http://camunda.org/schema/1.0/dmn">
|
||||
<decision id="users_to_groups" name="Users to Groups">
|
||||
<decisionTable id="decisionTable_1" hitPolicy="COLLECT" biodi:annotationsWidth="400">
|
||||
<input id="input_1" biodi:width="150">
|
||||
<inputExpression id="inputExpression_1" typeRef="string">
|
||||
<text>"*"</text>
|
||||
</inputExpression>
|
||||
</input>
|
||||
<output id="OutputClause_0vrbi1j" label="users" typeRef="string" />
|
||||
<output id="output_1" name="groups" typeRef="Any" biodi:width="262" />
|
||||
<rule id="DecisionRule_1xwvp7b">
|
||||
<inputEntry id="UnaryTests_01wus0h">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_18kwlie">
|
||||
<text>"admin@spiffworkflow.org"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0ykubgu">
|
||||
<text>"admin"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1rbbrcv">
|
||||
<inputEntry id="UnaryTests_0u0oanl">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_1r771e1">
|
||||
<text>"nelson@spiffworkflow.org"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_0z6b50n">
|
||||
<text>"organization"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_05sdhrp">
|
||||
<inputEntry id="UnaryTests_0pp8xqw">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_0zv6pu2">
|
||||
<text>"malala@spiffworkflow.org"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_07m82fl">
|
||||
<text>"education"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
<rule id="DecisionRule_1jn6v9t">
|
||||
<inputEntry id="UnaryTests_1srdiy4">
|
||||
<text></text>
|
||||
</inputEntry>
|
||||
<outputEntry id="LiteralExpression_1bz7u65">
|
||||
<text>r".*"</text>
|
||||
</outputEntry>
|
||||
<outputEntry id="LiteralExpression_1ibpvtx">
|
||||
<text>"everyone"</text>
|
||||
</outputEntry>
|
||||
</rule>
|
||||
</decisionTable>
|
||||
</decision>
|
||||
<dmndi:DMNDI>
|
||||
<dmndi:DMNDiagram id="DMNDiagram_1cykosu">
|
||||
<dmndi:DMNShape id="DMNShape_1dhfq2s" dmnElementRef="users_to_groups">
|
||||
<dc:Bounds height="80" width="180" x="157" y="151" />
|
||||
</dmndi:DMNShape>
|
||||
</dmndi:DMNDiagram>
|
||||
</dmndi:DMNDI>
|
||||
</definitions>
|
Loading…
x
Reference in New Issue
Block a user