As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfl:lifecycleapproval"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <!– Apply the Workflow Lifecycle Aspect (wfl:status) if not set already. Note: The default wfl:status property is draft –> <runas>admin</runas> <script> var dest = companyhome.childByNamePath(bpm_moveDestination); for (var i = 0 ; i < bpm_package.children.length; i++) { bpm_package.children.move(dest); } </script> </action> </process-definition>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="endevent1"> <extensionElements> <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> <activiti:string><![CDATA[logger.log("Hello, World!");]]></activiti:string> </activiti:field> </activiti:executionListener> </extensionElements> </sequenceFlow>
<?xml version="1.0" encoding="UTF-8" ?> <definitions id="lifecycle-definitions" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" 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"> <process id="activitiLifecycleApproval" name="Activiti Lifecycle Process"> <extensionElements> <!– When process is deleted/cancelled, status should be set to draft –> <activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> </activiti:field> </activiti:executionListener> </extensionElements> <startEvent id="startE"/> <sequenceFlow id='flow1' sourceRef='startE' targetRef='end'> <extensionElements> <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> <activiti:string> <runas>admin</runas> var dest = companyhome.childByNamePath(bpm_moveDestination); for (var i = 0 ; i < bpm_package.children.length; i++) { bpm_package.children.move(dest); } </activiti:string> </activiti:field> </activiti:executionListener> </extensionElements> </sequenceFlow> <endEvent id="end" /> </process> </definitions>
var workflow = actions.create("start-workflow"); workflow.parameters.workflowName = "jbpm$wfl:lifecycleapproval"; workflow.parameters["bpm:assignee"] = "us1"; workflow.parameters["bpm:moveDestination"] = "Sites/ar-rahnu/documentLibrary/SEMAKAN"; workflow.execute(document);
activiti$activitiLifecycleApproval
jbpm$wfl:lifecycleapproval
</activiti:field>
<extensionElements> <!– When process is deleted/cancelled, status should be set to draft –> <activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> </activiti:field> </activiti:executionListener>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="runAs"><activiti:string>admin</activiti:string></activiti:field> <activiti:field name="script"> <activiti:string> var dest = companyhome.childByNamePath(bpm_moveDestination); for (var i = 0 ; i < bpm_package.children.length; i++){ bpm_package.children.move(dest); } </activiti:string> </activiti:field> </activiti:executionListener>