THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Note | ||
---|---|---|
| ||
The content below is for Apache Syncope <= 1.2 - for later versions the Reference Guide is available. |
The following workflow will be delivered by default when you create your own Syncope instance.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <definitions id="definitions" targetNamespace="http://activiti.org/bpmn20" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd"> <process id="userWorkflow" name="User Workflow"> <startEvent id="theStart"/> <!-- Create an user --> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="createUsercreate"/> <serviceTask id="createUsercreate" name="Create user" activiti:class="org.apache.syncope.core.workflow.activiti.Create"/> <sequenceFlow id="flow2" sourceRef="createUsercreate" targetRef="approvalRequiredGWcreateGW"/> <exclusiveGateway id="approvalRequiredGWcreateGW"/> <sequenceFlow id="create2Activate" sourceRef="approvalRequiredGWcreateGW" targetRef="tokenRequiredGWenableGW"> <conditionExpression xsi:type="tFormalExpression">${!syncopeUser.getRoleIds().contains(9)}</conditionExpression> </sequenceFlow> <sequenceFlow id="create2userApprovalcreate2CreateApproval" sourceRef="approvalRequiredGWcreateGW" targetRef="createApproval"> <conditionExpression xsi:type="tFormalExpression">${syncopeUser.getRoleIds().contains(9)}</conditionExpression> </sequenceFlow> <userTask id="createApproval" activiti:formKey="userApprovalcreateApproval" name="UserCreate approval" activiti:candidateGroups="7"> <extensionElements> <activiti:formProperty id="username" name="Username" type="string" writable="false" expression="${syncopeUser.username}"/> <activiti:formProperty id="approve" variable="approve" name="Approve?" type="boolean" required="true"/> <activiti:formProperty id="rejectUserReasonrejectReason" variable="rejectUserReasonrejectReason" name="Reason for rejectUseringrejecting" type="string"/> </extensionElements> </userTask> <sequenceFlow id="flow3" sourceRef="createApproval" targetRef="userapprovalRequiredGWcreateApprovalGW"/> <exclusiveGateway id="userapprovalRequiredGWcreateApprovalGW"/> <sequenceFlow id="userapprovalRequiredGW2tokenRequiredGWcreateApprovalGW2EnableGW" sourceRef="userapprovalRequiredGWcreateApprovalGW" targetRef="tokenRequiredGWenableGW"> <conditionExpression xsi:type="tFormalExpression">${approve}</conditionExpression> </sequenceFlow> <sequenceFlow id="userApproval2rejectUsercreateApproval2Reject" sourceRef="userapprovalRequiredGWcreateApprovalGW" targetRef="rejectUserreject"> <conditionExpression xsi:type="tFormalExpression">${!approve}</conditionExpression> </sequenceFlow> <exclusiveGateway id="tokenRequiredGWenableGW"/> <!-- opt-in required --> <sequenceFlow id="userTokenRequiredcreateApprovalGW2OptIn" sourceRef="tokenRequiredGWenableGW" targetRef="generateUserConfirmationTokengenerateToken"> <conditionExpression xsi:type="tFormalExpression">${syncopeUser.getRoleIds().contains(11)}</conditionExpression> </sequenceFlow> <sequenceFlow id="userTokenNotRequired" sourceRef="tokenRequiredGW" targetRef="userActiveGW"> <conditionExpression xsi:type="tFormalExpression">${!syncopeUser.getRoleIds().contains(11)}</conditionExpression> </sequenceFlow> <exclusiveGateway id="userActiveGW"/> <!-- activate user if suspension is not <!-- activate user if suspension is not required --> <sequenceFlow id="userapprovalRequiredGW2ActivatecreateApprovalGW2Activate" sourceRef="userActiveGWenableGW" targetRef="activateUseractivate"> <conditionExpression xsi:type="tFormalExpression">${enabled==null}</conditionExpression> </sequenceFlow> <sequenceFlow id="userapprovalRequiredGW2ActivecreateApprovalGW2Active" sourceRef="userActiveGWenableGW" targetRef="active"> <conditionExpression xsi:type="tFormalExpression">${enabled}</conditionExpression> </sequenceFlow> <sequenceFlow id="userapprovalRequiredGW2SuspendedcreateApprovalGW2Suspended" sourceRef="userActiveGWenableGW" targetRef="suspendUsersuspend"> <conditionExpression xsi:type="tFormalExpression">${!enabled}</conditionExpression> </sequenceFlow> <serviceTask id="activateUseractivate" name="activateUserActivate" activiti:class="org.apache.syncope.core.workflow.activiti.AutoActivate"/> <sequenceFlow id="flow4" sourceRef="activateUseractivate" targetRef="active"/> <!-- Double opt-in required --> <serviceTask id="generateUserConfirmationTokengenerateToken" name="Generate token" activiti:class="org.apache.syncope.core.workflow.activiti.GenerateToken"/> <sequenceFlow id="flow5" sourceRef="generateUserConfirmationTokengenerateToken" targetRef="created"/> <userTask id="created" name="provideUserConfirmationTokenCreated"/> <sequenceFlow id="flow6" sourceRef="created" targetRef="tokenValidationGWoptinGW"/> <exclusiveGateway id="tokenValidationGWoptinGW"/> <sequenceFlow id="provideUserConfirmationToken2removeUserConfirmationTokencreated2Activate" sourceRef="tokenValidationGWoptinGW" targetRef="removeUserConfirmationTokenremoveToken"> <conditionExpression xsi:type="tFormalExpression">${syncopeUser.checkToken(token)}</conditionExpression> </sequenceFlow> <sequenceFlow id="provideUserConfirmationToken2provideUserConfirmationTokencreated2Created" sourceRef="tokenValidationGWoptinGW" targetRef="created"> <conditionExpression xsi:type="tFormalExpression">${!syncopeUser.checkToken(token)}</conditionExpression> </sequenceFlow> <scriptTask id="removeUserConfirmationTokenremoveToken" name="Remove Token and activateUserActivate" scriptFormat="groovy"> <script> syncopeUser.removeToken() </script> </scriptTask> <sequenceFlow id="flow7" sourceRef="removeUserConfirmationTokenremoveToken" targetRef="active"/> <userTask id="active" name="userActive"/> <sequenceFlow id="flow8" sourceRef="active" targetRef="suspendUserGw"/> <exclusiveGateway id="suspendUserGw id="active" name="Active"/> <sequenceFlow id="userActive2modifyUserGWflow8" sourceRef="suspendUserGwactive" targetRef="modifyUserGWactiveGw"/> <conditionExpression xsi:type<exclusiveGateway id="tFormalExpression">${task != 'suspend'}</conditionExpression> </sequenceFlow> activeGw"/> <sequenceFlow id="userActive2suspendUseractive2Update" sourceRef="suspendUserGwactiveGw" targetRef="suspendUserupdate"> <conditionExpression xsi:type="tFormalExpression">${task == 'suspendupdate'}</conditionExpression> </sequenceFlow> <exclusiveGateway id="modifyUserGW"/> <sequenceFlow id="active2updateUseractive2Suspend" sourceRef="modifyUserGWactiveGw" targetRef="updateUsersuspend"> <conditionExpression xsi:type="tFormalExpression">${task == 'updatesuspend'}</conditionExpression> </sequenceFlow> <sequenceFlow id="active2deleteUseractive2Delete" sourceRef="modifyUserGWactiveGw" targetRef="deleteUserdelete"> <conditionExpression xsi:type="tFormalExpression">${task == 'delete'}</conditionExpression> </sequenceFlow> <!-- Update an active user --> <serviceTask id="updateUserupdate" name="updateUserUpdate" activiti:class="org.apache.syncope.core.workflow.activiti.Update"/> <sequenceFlow id="flow9" sourceRef="updateUserupdate" targetRef="userActiveGWactive"/> <!-- suspendUserSuspend an active user --> <serviceTask id="suspendUsersuspend" name="suspendUserSuspend" activiti:class="org.apache.syncope.core.workflow.activiti.Suspend"/> <sequenceFlow id="flow10" sourceRef="suspendUsersuspend" targetRef="suspended"/> <userTask id="suspended" name="UserSuspendedSuspended"/> <sequenceFlow id="flow11" sourceRef="suspended" targetRef="reactivateUserGWsuspendedGw"/> <exclusiveGateway id="reactivateUserGWsuspendedGw"/> <sequenceFlow id="suspended2reactivatesuspended2Reactivate" sourceRef="reactivateUserGWsuspendedGw" targetRef="reactivateUserreactivate"> <conditionExpression xsi:type="tFormalExpression">${task == 'reactivate'}</conditionExpression> </sequenceFlow> <sequenceFlow id="suspended2modifysuspended2Delete" sourceRef="reactivateUserGWsuspendedGw" targetRef="modifyUserGWdelete"> <conditionExpression xsi:type="tFormalExpression">${task !== 'reactivatedelete'}</conditionExpression> </sequenceFlow> <!-- Reactivate a suspended user --> <serviceTask id="reactivateUserreactivate" name ="reactivateUserReactivate" activiti:class="org.apache.syncope.core.workflow.activiti.Reactivate"/> <sequenceFlow id="flow12" sourceRef="reactivateUserreactivate" targetRef="active"/> <!-- rejectUserReject an user --> <scriptTask id="rejectUserreject" name="rejectUserReject" scriptFormat="groovy"> <!-- Do something with rejectUserReasonrejectReason --> <script> def scriptVar = rejectUserReasonrejectReason </script> </scriptTask> <sequenceFlow id="flow13" sourceRef="rejectUserreject" targetRef="rejectedUserrejected"/> <userTask id="rejectedUserrejected" name="rejectedUserRejected"/> <sequenceFlow id="flow14" sourceRef="rejectedUserrejected" targetRef="deleteUserdelete"/> <!-- Delete an user (provideUserConfirmationTokencreated, active or suspended) --> <serviceTask id="deleteUserdelete" name="deleteUserDelete" activiti:class="org.apache.syncope.core.workflow.activiti.Delete"/> <sequenceFlow id="flow99" sourceRef="deleteUserdelete" targetRef="theEnd"/> <endEvent id="theEnd"/> </process> </definitions> |