05-14-2014 08:16 AM
<?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>
05-14-2014 09:49 AM
<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>
05-17-2014 01:01 AM
<?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);
05-17-2014 07:46 AM
activiti$activitiLifecycleApproval
,you are using jbpm$wfl:lifecycleapproval
in your javascrit,so the above workflow might be not executed at all. </activiti:field>
in below code is no use (you didn't add javascript into it) .Please delete the whole session.,otherwise it might cause error
<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>
03-23-2015 03:13 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.