cancel
Showing results for 
Search instead for 
Did you mean: 

workflow modifications in Explorer -> affected in Share?

ktulu77
Champ in-the-making
Champ in-the-making
Hi,

I have added scripts actions on the review & approve workflow (by editing the xml definition file). This file is in the Alfresco Explorer project so I would like to know if these modifications will also take effect on the Share interface ?

Basically, I have just added scripts to approve and reject states, I would like to know if these scripts will also be executed within the share interface, when an user will reject or approve.

I am using this trick to move files when the wokflow state changes (I don't want to use basic workflow).

Thank you in advance for your help.
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Yes, currently Share only supports the default "Adhoc" and "Review and Approve" workflows, so any modifications to these will also be picked up in Share.

Thanks,
Mike

ktulu77
Champ in-the-making
Champ in-the-making
Thank you for your response. I have done the changes, but nothing seems to happen.
This is my file alfresco/workflow/review_processdefinition.xml :

<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:review">
    <swimlane name="initiator" />
    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" />
        <transition name="" to="review" />
    </start-state>

    <swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>
        </assignment>   
    </swimlane>

    <task-node name="review">
        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                <script>
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>

        <transition name="approve" to="approved">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <script>
         var dest = companyhome.childByNamePath("Sites/toto/documentLibrary/Published");
         for (var i = 0; i &lt; bpm_package.children.length; i++)
         {
         bpm_package.children[i].move(dest);
         }
         </script>
      </action>
   </transition>

        <transition name="reject" to="rejected" >
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <script>
         var dest = companyhome.childByNamePath("Sites/toto/documentLibrary/Drafts");
         for (var i = 0; i &lt; bpm_package.children.length; i++)
         {
         bpm_package.children[i].move(dest);
         }
         </script>
      </action>
   </transition>
    </task-node>

    <task-node name="rejected">
        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wf:approvedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <end-state name="end" />

</process-definition>

But, when I assign a new Review & Approve workflow to a content, and I set it to approve with Alfresco Explorer, the workflow state is set to approve, but the content does not move to the desired path. I don't have any exceptions.

I know that the modifications are considered because if I break for example a xml close marker, I have an exception when I start the server.

What am I doing wrong ?

Thank you

jayjayecl
Confirmed Champ
Confirmed Champ
Have a look at the file "bootstrap-context.xml" in WEB-INF/classes/alfresco.



<bean id="workflowBootstrap" parent="workflowDeployer">
        <property name="workflowDefinitions">
            <list>
                <props>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/review_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>

Last property claims that the definition won't be redeployed. Then, your modifications won't be loaded and deployed.
Set it to "true" if you want the processDefinition to be redeployed each time the server is started

ktulu77
Champ in-the-making
Champ in-the-making
Thank you, it works Smiley Happy

Just one little thing, it works too on the share interface, but I have changed the translations of this workflow in the file "workflow-messages.properties". But the share interface does not seem to use that file.

Is it hard coded somewhere ? I am going to check that in the jsp files. Anyway, the hardest things are done, thank you for your help.

jayjayecl
Confirmed Champ
Confirmed Champ
No problem.
I can't help you on that issue, I have too little experience on share, except knowing that, indeed, those properties files aren't used.

However, try to find the file "slingshot.properties" and throw a look at it, you might find what you're looking for
Getting started

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.