AnsweredAssumed Answered

Checkout in a Workflow

Question asked by bclarke on Apr 5, 2007
Latest reply on Apr 11, 2007 by bclarke
Hi,
I try to modify a given workflow (lifecycle_definition.xml).
My aim is to extract a working copy of the attached document in the personnal folder of the workflow assignee.
I've modified the following code in lifecycle_definition.xml :

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfl:lifecycleapproval">
    <swimlane name="initiator" />
    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" />
        <event type="node-leave">
            <!– Call script once the workflow package exists i.e. on node-leave –>
            <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 –>
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       if (!bpm_package.children[i].hasAspect("wfl:status"))
                       {
                          bpm_package.children[i].addAspect("wfl:status");
                          bpm_package.children[i].checkout(bpm_context);
                       }
                    }
I get a org.alfresco.service.cmr.lock.NodeLockedException
The document seems to be locked. Is it possible to unlock it? how?
Does someone can help me?

Outcomes