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

Fix sample model 029

parent df2026a4
No related branches found
No related tags found
1 merge request!114Merging develop into main
This commit is part of merge request !114. Comments created here will be created in the context of that merge request.
---
title: ECA Library - Add role to inserted or updated user
version: v2
version: v3
tags:
- bpmn
- library
......@@ -12,7 +12,7 @@ tags:
---
# Add role to inserted or updated user
Version v2
Version v3
<script>url='bpmn_io-eca_lib_0029.xml';archive='bpmn_io-eca_lib_0029.tar.gz'</script>
{!include/library/viewer.html!}
......@@ -64,3 +64,7 @@ The creation of this module was recorded and the video with additional explanati
`v2`
: Clean-up the model
`v3`
: Do not save entity as this model acts in pre-save event
No preview for this file type
<?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>
......@@ -25,7 +26,7 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -38,7 +39,7 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -53,11 +54,11 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -68,11 +69,11 @@ The creation of this module was recorded and the video with additional explanati
</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>
......@@ -87,7 +88,7 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -102,7 +103,7 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -115,11 +116,11 @@ The creation of this module was recorded and the video with additional explanati
</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>
......@@ -133,7 +134,7 @@ The creation of this module was recorded and the video with additional explanati
<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>
......@@ -150,55 +151,55 @@ The creation of this module was recorded and the video with additional explanati
<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.
Please register or to comment