c5e82a0c28bdc179de9af4587b5fe9572a963279omebold<?xml version="1.0" encoding="UTF-8"?>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="Examples" id="definitions" xsi:schemaLocation=" http://www.omg.org/spec/BPMN/20100524/MODEL http://local.openicf.forgerock.org/BPMN20.xsd">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <process id="sunrise" name="Sunrise process" isExecutable="true">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <startEvent id="start" activiti:initiator="startUserId"></startEvent>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <sequenceFlow id="sequenceFlow-56954256-f914-47aa-a2db-658c825e9a69" sourceRef="start" targetRef="activateManagedUser"></sequenceFlow>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <scriptTask id="activateManagedUser" name="Activate User" scriptFormat="groovy" activiti:autoStoreVariables="false">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <script>
a7032a112e6fbd9aa9b8396cb9f8e047db9484d4omebold user = openidm.read(userId)
a7032a112e6fbd9aa9b8396cb9f8e047db9484d4omebold
a7032a112e6fbd9aa9b8396cb9f8e047db9484d4omebold params = [[operation:'replace', field:'accountStatus', value :'active'],
a7032a112e6fbd9aa9b8396cb9f8e047db9484d4omebold [operation:'add', field:'sunrise/dateProcessed', value:user.sunrise.date],
a7032a112e6fbd9aa9b8396cb9f8e047db9484d4omebold [operation:'remove', field:'sunrise/date']]
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold openidm.patch(userId, null, params)
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold java.text.SimpleDateFormat formatUTC = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'");
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold formatUTC.setTimeZone(TimeZone.getTimeZone("UTC"));
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold requestDate = formatUTC.format(new Date());
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold def notification = [
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "receiverId": userId.split('/')[-1],
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "requesterId" : "",
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "requester" : "",
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "createDate" : requestDate,
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "notificationType" : "info",
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "notificationSubtype" : "",
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold "message" : "Your account was successfully activated."
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold ];
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold openidm.create("repo/ui/notification/", null, notification)
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold
c5e82a0c28bdc179de9af4587b5fe9572a963279omebold </script>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </scriptTask>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <sequenceFlow id="sequenceFlow-1770cc72-bfa9-47ce-bb7f-b2f15d73878d" sourceRef="activateManagedUser" targetRef="end"></sequenceFlow>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <endEvent id="end"></endEvent>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </process>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNDiagram id="BPMNDiagram_sunrise">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNPlane bpmnElement="sunrise" id="BPMNPlane_sunrise">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdc:Bounds height="35.0" width="35.0" x="0.0" y="15.0"></omgdc:Bounds>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNShape>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNShape bpmnElement="activateManagedUser" id="BPMNShape_activateManagedUser">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdc:Bounds height="60.0" width="100.0" x="80.0" y="0.0"></omgdc:Bounds>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNShape>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdc:Bounds height="35.0" width="35.0" x="230.0" y="15.0"></omgdc:Bounds>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNShape>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNEdge bpmnElement="sequenceFlow-56954256-f914-47aa-a2db-658c825e9a69" id="BPMNEdge_sequenceFlow-56954256-f914-47aa-a2db-658c825e9a69">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="35.0" y="32.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="42.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="80.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNEdge>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <bpmndi:BPMNEdge bpmnElement="sequenceFlow-1770cc72-bfa9-47ce-bb7f-b2f15d73878d" id="BPMNEdge_sequenceFlow-1770cc72-bfa9-47ce-bb7f-b2f15d73878d">
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="180.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="192.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="192.0" y="30.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott <omgdi:waypoint x="230.0" y="32.0"></omgdi:waypoint>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNEdge>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNPlane>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott </bpmndi:BPMNDiagram>
401ce219a5423f42a16514d7c724367b756a28a4huck.elliott</definitions>