Skip to content
Snippets Groups Projects
Commit 40a62f98 authored by jurgenhaas's avatar jurgenhaas
Browse files

Fix sample model 029

parent 777f7993
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ dependencies:
id: eca_lib_0029
modeller: bpmn_io
label: 'Add role to inserted or updated user'
version: v2
version: v3
weight: 0
events:
Event_15fsmqd:
......@@ -74,7 +74,7 @@ actions:
method: 'append:not_full'
strip_tags: false
trim: false
save_entity: true
save_entity: false
object: saveduser
successors:
-
......
......@@ -19,21 +19,22 @@ filename: ''
modeldata: |
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:qa="http://some-company/schema/bpmn/qa" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="eca_lib_0029" name="Add role to inserted or updated user" isExecutable="true" camunda:versionTag="v2">
<bpmn2:process id="eca_lib_0029" name="Add role to inserted or updated user" isExecutable="true" camunda:versionTag="v3">
<bpmn2:documentation>This model demonstrates how to add a role to an inserted or updated user entity. There are actually 3 potential ways of doing this, only 1 of them being recommended. The recorded session (see link below) shows the issues you can run into when choosing one of the other options and it may become transparent, why the third option is the best of the available ones.
The creation of this module was recorded and the video with additional explanations can be [watched here](https://tube.tchncs.de/w/odtnGZjaEAKtzZSVX1gdAS).</bpmn2:documentation>
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="Changelog v1" value="Initial version"/>
<camunda:property name="Tags" value="simple,presave,insert,update,content entity"/>
<camunda:property name="Changelog v2" value="Clean-up the model"/>
<camunda:property name="Changelog v1" value="Initial version" />
<camunda:property name="Tags" value="simple,presave,insert,update,content entity" />
<camunda:property name="Changelog v2" value="Clean-up the model" />
<camunda:property name="Changelog v3" value="Do not save entity as this model acts in pre-save event" />
</camunda:properties>
</bpmn2:extensionElements>
<bpmn2:startEvent id="Event_15fsmqd" name="Presave User" camunda:modelerTemplate="org.drupal.event.content_entity:presave">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="content_entity:presave"/>
<camunda:property name="pluginid" value="content_entity:presave" />
</camunda:properties>
<camunda:field name="type">
<camunda:string>user _all</camunda:string>
......@@ -44,7 +45,7 @@ modeldata: |
<bpmn2:task id="Activity_1r7v54x" name="Switch to user 1" camunda:modelerTemplate="org.drupal.action.eca_switch_account">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="eca_switch_account"/>
<camunda:property name="pluginid" value="eca_switch_account" />
</camunda:properties>
<camunda:field name="user_id">
<camunda:string>1</camunda:string>
......@@ -57,7 +58,7 @@ modeldata: |
<bpmn2:task id="Activity_1kz152s" name="Load saved user entity" camunda:modelerTemplate="org.drupal.action.eca_token_set_value">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="eca_token_set_value"/>
<camunda:property name="pluginid" value="eca_token_set_value" />
</camunda:properties>
<camunda:field name="token_name">
<camunda:string>saveduser</camunda:string>
......@@ -72,11 +73,11 @@ modeldata: |
<bpmn2:incoming>Flow_1gi20r4</bpmn2:incoming>
<bpmn2:outgoing>Flow_1gsqlu4</bpmn2:outgoing>
</bpmn2:task>
<bpmn2:sequenceFlow id="Flow_1gsqlu4" sourceRef="Activity_1kz152s" targetRef="Activity_1r7v54x"/>
<bpmn2:sequenceFlow id="Flow_1gsqlu4" sourceRef="Activity_1kz152s" targetRef="Activity_1r7v54x" />
<bpmn2:task id="Activity_1jrvkj9" name="Print success message" camunda:modelerTemplate="org.drupal.action.action_message_action">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="action_message_action"/>
<camunda:property name="pluginid" value="action_message_action" />
</camunda:properties>
<camunda:field name="message">
<camunda:string>Succeeded !!!</camunda:string>
......@@ -87,11 +88,11 @@ modeldata: |
</bpmn2:extensionElements>
<bpmn2:incoming>Flow_1dhqote</bpmn2:incoming>
</bpmn2:task>
<bpmn2:sequenceFlow id="Flow_1gi20r4" sourceRef="Event_15fsmqd" targetRef="Activity_1kz152s"/>
<bpmn2:sequenceFlow id="Flow_1gi20r4" sourceRef="Event_15fsmqd" targetRef="Activity_1kz152s" />
<bpmn2:task id="Activity_0wn1igg" name="Add role to field" camunda:modelerTemplate="org.drupal.action.eca_set_field_value">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="eca_set_field_value"/>
<camunda:property name="pluginid" value="eca_set_field_value" />
</camunda:properties>
<camunda:field name="method">
<camunda:string>append:not_full</camunda:string>
......@@ -106,7 +107,7 @@ modeldata: |
<camunda:string>roles</camunda:string>
</camunda:field>
<camunda:field name="save_entity">
<camunda:string>yes</camunda:string>
<camunda:string>no</camunda:string>
</camunda:field>
<camunda:field name="field_value">
<camunda:string>content_editor</camunda:string>
......@@ -121,7 +122,7 @@ modeldata: |
<bpmn2:sequenceFlow id="Flow_1q84r8w" name="does not have role?" camunda:modelerTemplate="org.drupal.condition.eca_user_role" sourceRef="Activity_1r7v54x" targetRef="Activity_0wn1igg">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="eca_user_role"/>
<camunda:property name="pluginid" value="eca_user_role" />
</camunda:properties>
<camunda:field name="account">
<camunda:string>[saveduser]</camunda:string>
......@@ -134,11 +135,11 @@ modeldata: |
</camunda:field>
</bpmn2:extensionElements>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="Flow_1dhqote" sourceRef="Activity_0wn1igg" targetRef="Activity_1jrvkj9"/>
<bpmn2:sequenceFlow id="Flow_1dhqote" sourceRef="Activity_0wn1igg" targetRef="Activity_1jrvkj9" />
<bpmn2:task id="Activity_1ad4xtj" name="Print fail message" camunda:modelerTemplate="org.drupal.action.action_message_action">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="action_message_action"/>
<camunda:property name="pluginid" value="action_message_action" />
</camunda:properties>
<camunda:field name="message">
<camunda:string>User already has the role.</camunda:string>
......@@ -152,7 +153,7 @@ modeldata: |
<bpmn2:sequenceFlow id="Flow_14b3t2b" name="has role?" camunda:modelerTemplate="org.drupal.condition.eca_user_role" sourceRef="Activity_1r7v54x" targetRef="Activity_1ad4xtj">
<bpmn2:extensionElements>
<camunda:properties>
<camunda:property name="pluginid" value="eca_user_role"/>
<camunda:property name="pluginid" value="eca_user_role" />
</camunda:properties>
<camunda:field name="account">
<camunda:string>[saveduser]</camunda:string>
......@@ -169,55 +170,55 @@ modeldata: |
<bpmndi:BPMNDiagram id="sid-4332adf4-0181-4bb4-b154-c4cd06697b0a">
<bpmndi:BPMNPlane id="sid-48cda04e-4989-49da-97ff-05fc88a71eaf" bpmnElement="eca_lib_0029">
<bpmndi:BPMNShape id="Event_15fsmqd_di" bpmnElement="Event_15fsmqd">
<dc:Bounds x="212" y="162" width="36" height="36"/>
<dc:Bounds x="212" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="197" y="205" width="67" height="14"/>
<dc:Bounds x="197" y="205" width="67" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1r7v54x_di" bpmnElement="Activity_1r7v54x">
<dc:Bounds x="490" y="140" width="100" height="80"/>
<bpmndi:BPMNLabel/>
<dc:Bounds x="490" y="140" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1kz152s_di" bpmnElement="Activity_1kz152s">
<dc:Bounds x="320" y="140" width="100" height="80"/>
<bpmndi:BPMNLabel/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0wn1igg_di" bpmnElement="Activity_0wn1igg">
<dc:Bounds x="490" y="280" width="100" height="80"/>
<bpmndi:BPMNLabel/>
<dc:Bounds x="320" y="140" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1jrvkj9_di" bpmnElement="Activity_1jrvkj9">
<dc:Bounds x="660" y="280" width="100" height="80"/>
<bpmndi:BPMNLabel/>
<dc:Bounds x="660" y="280" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0wn1igg_di" bpmnElement="Activity_0wn1igg">
<dc:Bounds x="490" y="280" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1ad4xtj_di" bpmnElement="Activity_1ad4xtj">
<dc:Bounds x="660" y="140" width="100" height="80"/>
<bpmndi:BPMNLabel/>
<dc:Bounds x="660" y="140" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1gsqlu4_di" bpmnElement="Flow_1gsqlu4">
<di:waypoint x="420" y="180"/>
<di:waypoint x="490" y="180"/>
<di:waypoint x="420" y="180" />
<di:waypoint x="490" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1gi20r4_di" bpmnElement="Flow_1gi20r4">
<di:waypoint x="248" y="180"/>
<di:waypoint x="320" y="180"/>
<di:waypoint x="248" y="180" />
<di:waypoint x="320" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1q84r8w_di" bpmnElement="Flow_1q84r8w">
<di:waypoint x="540" y="220"/>
<di:waypoint x="540" y="280"/>
<di:waypoint x="540" y="220" />
<di:waypoint x="540" y="280" />
<bpmndi:BPMNLabel>
<dc:Bounds x="543" y="240" width="73" height="27"/>
<dc:Bounds x="543" y="240" width="73" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_1dhqote_di" bpmnElement="Flow_1dhqote">
<di:waypoint x="590" y="320"/>
<di:waypoint x="660" y="320"/>
<di:waypoint x="590" y="320" />
<di:waypoint x="660" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_14b3t2b_di" bpmnElement="Flow_14b3t2b">
<di:waypoint x="590" y="180"/>
<di:waypoint x="660" y="180"/>
<di:waypoint x="590" y="180" />
<di:waypoint x="660" y="180" />
<bpmndi:BPMNLabel>
<dc:Bounds x="597" y="183" width="46" height="14"/>
<dc:Bounds x="597" y="183" width="46" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment