cancel
Showing results for 
Search instead for 
Did you mean: 

Web Site Submission workflow to use in the explorer

userfresco
Champ in-the-making
Champ in-the-making
Hi,

My question relates to advanced workflow.
In Alfresco 3.3 Explorer when the contextmenu 'Start Advanced Workflow' is clicked on a file item in a site. You are presented with the option to choose from a list of available workflows
After renaming *.sample  and restarting 5 workflows becomes available to choose from. Ok.

Available workflows:
Adhoc Task (Assign task to colleague)
Group Review & Approve (Group review & approval of content)
Parallel Review & Approve (Parallel Review & approval of content)
Pooled Review & Approve (Pooled review & approval of content)
Review & Approve (Review & approval of content)

Now in a Web Project after creation, during the process of submitting a web form from your sandbox , an option under the workflow heading 'Web Site Submission(Submit changes for approval)' is available.

It is this workflow with serial option 'multiple serail review' that I would like to relocate to use in explorer.

What needs to be done in order to make 'Web Site Submission(Submit changes for approval)' workflow available as an option in Alfresco Explorer's available workflows list?
As in the example below:

Available workflows:
Adhoc Task (Assign task to colleague)
Group Review & Approve (Group review & approval of content)
Parallel Review & Approve (Parallel Review & approval of content)
Pooled Review & Approve (Pooled review & approval of content)
Review & Approve (Review & approval of content)
Web Site Submission(Submit changes for approval) - perhaps renamed to something without reference to 'web site'

Any help or alternatives is very welcome.

Thank you in advance.
15 REPLIES 15

userfresco
Champ in-the-making
Champ in-the-making
Hi,

I have managed to create a serial workflow with success in alfresco explorer, the item displays properly after the 'start advanced workflow' context menu click > Start Advanced Workflow Wizard > Choose Workflow

Two errors are however still unsolved as noted in section c) and l) respectively.
Below are the steps and code files to recreate the error for anyone out there interested to give it a try.
Any help or alternatives are most welcome.

a) After a clean install of version 3.3 the following 2 files are uploaded and 2 file updated:

1.serialreview_processdefinition.xml (uploaded to: Company Home > Data Dictionary > Workflow Definitions)

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:serialreview">

   <swimlane name="initiator"/>

   <start-state name="start">
      <task name="wf:submitSerialReviewTask" swimlane="initiator"/>
      <transition name="" to="startreview"/>
   </start-state>

   <decision name="startreview">
      <event type="node-enter">
         <script>
            <variable name="wf_reviewCycle" access="write"/>
            <variable name="wf_reviewerCount" access="write"/>
            <variable name="wf_approveCount" access="write"/>
            <expression>
               wf_reviewerCount = bpm_assignees.size();
               wf_approveCount = 0;
               wf_reviewCycle = 1;
            </expression>
         </script>
      </event>

      <transition name="serial" to="submitserialreview" />
   </decision>


   <!–               –>
   <!– Serial Review –>
   <!–               –>

   <decision name="submitserialreview">
      <transition name="endreview" to="endreview" />
      <transition name="review" to="serialreview">
         <condition>#{wf_approveCount &lt; wf_reviewerCount}</condition>
      </transition>
   </decision>

   <task-node name="serialreview">
      <task name="wf:reviewTask">
         <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignees.get(wf_approveCount)}</actor>
         </assignment>
         <event type="task-assign">
            <script>
               if (wf_reviewCycle > 1)taskInstance.description = taskInstance.description + " (" + wf_reviewCycle + ")";
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
      </task>

      <transition name="approve" to="submitserialreview">
         <script>
            <variable name="wf_approveCount" access="read, write"/>
            <expression>
               wf_approveCount = wf_approveCount + 1;
            </expression>
         </script>
      </transition>
      <transition name="reject" to="endreview" />
   </task-node>


   <!–                –>
   <!– End the Review –>
   <!–                –>

   
   <decision name="endreview">
      <transition name="rejected" to="rejected" />
      <transition to="end" name="to end">
         <condition>#{wf_approveCount == wf_reviewerCount}</condition>
      </transition>
   </decision>
     
   <task-node name="rejected">
      <task name="wf:rejectedTask" swimlane="initiator" >
         <event type="task-assign">
            <script>
               if (wf_reviewCycle > 1)
               taskInstance.description = taskInstance.description + " (" + wf_reviewCycle + ")";
            </script>
         </event>
      </task>
      <transition name="abort" to="end" />
      <transition name="resubmit" to="initialise">
         <!– restart review process (next cycle) –>
         <script>
            <variable name="wf_reviewCycle" access="read,write" />
            <expression>
               wf_reviewCycle = wf_reviewCycle +1;
            </expression>
         </script>
      </transition>
   </task-node>

   <!–                 –>
   <!– End the Process –>
   <!–                 –>

   <end-state name="end"/>

   <event type="process-end">
      <script>
         <!–                 –>
      </script>
   </event>

</process-definition>


2.serial-messages.properties (uploaded to : Company Home > Data Dictionary > Messages)


#
# Serial Review Workflow
#

wf_serialreview.workflow.title=Serial Review & Approve
wf_serialreview.workflow.description=Serial Review & approval of content

# Serial Review & Approve Task Definitions

wf_workflowmodel.type.wf_submitSerialReviewTask.title=Start Serial Review
wf_workflowmodel.type.wf_submitSerialReviewTask.description=Submit documents for review & approval to a list of people
wf_workflowmodel.property.wf_requiredApprovePercent.title=Required approval percentage
wf_workflowmodel.property.wf_requiredApprovePercent.description=Percentage of reviewers who must approve for approval
wf_workflowmodel.type.wf_rejectedSerialTask.title=Rejected
wf_workflowmodel.type.wf_rejectedSerialTask.description=Rejected
wf_workflowmodel.type.wf_approvedSerialTask.title=Approved
wf_workflowmodel.type.wf_approvedSerialTask.description=Approved
wf_workflowmodel.property.wf_reviewerCount.title=Number of reviewers
wf_workflowmodel.property.wf_reviewerCount.description=Number of reviewers

wf_workflowmodel.property.wf_approveCount.title=Reviewers who approved
wf_workflowmodel.property.wf_approveCount.description=Reviewers who approved


wf_reviewers=Reviewers



3.web-client-config-custom.xml (updated and uploaded to : Company Home > Data Dictionary > Web Client Extension)
I added the following code before </alfresco-config> and after the last   </config> tag.


   <config evaluator="node-type" condition="wf:submitSerialReviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="wf_review_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="wf_review_due_date" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignees" display-label-id="wf_reviewers" />
      </property-sheet>
   </config>


4.workflowModel.xml (updated in : \Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow)\
below the wf:submitParallelReviewTask entry as indicated in the code below, I have added wf:submitSerialReviewTask that has parent bpm:startTask


      <!–  Submit review to multiple people (explicit list) –>
      <type name="wf:submitParallelReviewTask">
         <parent>wf:submitConcurrentReviewTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>

      <!–  Submit Serial review to multiple people (explicit list) –>
      <type name="wf:submitSerialReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>


b) Restart for changes in workflowModel.xml to take effect.

c) Now reload, activate, deploy by doing the following:

http://localhost:8080/alfresco/faces/jsp/admin/webclientconfig-console.jsp
ok> reload

with results
Web Client config has been reloaded

<Built-in evaluators> —> OK
classpath:alfresco/web-client-config.xml —> OK
classpath:alfresco/web-client-config-dialogs.xml —> OK
classpath:alfresco/web-client-config-wizards.xml —> OK
classpath:alfresco/web-client-config-properties.xml —> OK
classpath:alfresco/web-client-config-navigation.xml —> OK
classpath:alfresco/web-client-config-wcm.xml —> OK
classpath:alfresco/web-client-config-actions.xml —> OK
classpath:alfresco/web-client-config-forum-actions.xml —> OK
classpath:alfresco/web-client-config-wcm-actions.xml —> OK
classpath:alfresco/web-client-config-workflow-actions.xml —> OK
classpath:alfresco/extension/web-client-config-custom.xml —> OK
workspace://SpacesStore/app:company_home/app:dictionary/app:webclient_extension/cm:web-client-config-custom.xml —> OK


http://localhost:8080/alfresco/faces/jsp/admin/repoadmin-console.jsp
ok> reload messages serial-messages

with results
Message resource bundle reloaded: serial-messages

http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp
ok> deploy alfresco/extension/workflows/serialreview_processdefinition.xml

note that you get a error here, i did however deploy without errors when uploaded to Company Home > Sites > Data Dictionary > Workflow Definitions with the Workflow Deployed checkbox ticked.

org.alfresco.error.AlfrescoRuntimeException: 04120000 Exception in Transaction

d) upload a dummy file to use for the workflow, create a second user as well.
e) 'start advanced workflow' context menu click > Start Advanced Workflow Wizard > Choose Workflow and fill in the fields
f) set due date to today
g) set reviewers in sequence 'admin' and second user created in d)
h) go to my alfresco and click on the task with description as entered  in e)
i) reject the task with button click
j) repeat h)
k) abort the task with button click
l) notice the error

Please correct the errors below then click OK.
* A system error happened during the operation: 04120005 Mandatory task properties have not been provided: {http://www.alfresco.org/model/bpm/1.0}assignee

Thank you in advance.

userfresco
Champ in-the-making
Champ in-the-making
Hi,

I found the error (thanks to good old grep) and post it here not only for myself but for others to use as well. All five code files can be found below.

The solution is to:
1. rename wf:rejectedTask in the serialreview_processdefinition.xml file to wf:rejectedSerialTask
2. and to add an additional type "wf:rejectedSerialTask" in the workflowModel.xml file

as shown below.

<task-node name="rejected">
      <task name="wf:rejectedTask" swimlane="initiator" >

<task-node name="rejected">
      <task name="wf:rejectedSerialTask" swimlane="initiator" >

Here are the files needed to get serial review working

1.serialreview_processdefinition.xml (uploaded to: Company Home > Data Dictionary > Workflow Definitions)

<?xml version="1.0" encoding="UTF-8"?>

<!–  Filename: serialreview_processdefinition.xml
     Description: This altered file describes additional entries for the serial review workflow
     Usage: Upload file to : Company Home > Data Dictionary > Workflow Definitions
     Version: Alfresco Community 3.3
     Author: Karel Jordaan
–>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:serialreview">

   <swimlane name="initiator"/>

   <start-state name="start">
      <task name="wf:submitSerialReviewTask" swimlane="initiator"/>
      <transition name="" to="startreview"/>
   </start-state>

   <decision name="startreview">
      <event type="node-enter">
         <script>
            <variable name="wf_reviewCycle" access="write"/>
            <variable name="wf_reviewerCount" access="write"/>
            <variable name="wf_approveCount" access="write"/>
            <expression>
               wf_reviewerCount = bpm_assignees.size();
               wf_approveCount = 0;
               wf_reviewCycle = 1;
            </expression>
         </script>
      </event>

      <transition name="serial" to="submitserialreview" />
   </decision>


   <!–               –>
   <!– Serial Review –>
   <!–               –>

   <decision name="submitserialreview">
      <transition name="endreview" to="endreview" />
      <transition name="review" to="serialreview">
         <condition>#{wf_approveCount &lt; wf_reviewerCount}</condition>
      </transition>
   </decision>

   <task-node name="serialreview">
      <task name="wf:reviewTask">
         <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignees.get(wf_approveCount)}</actor>
         </assignment>
         <event type="task-assign">
            <script>
               if (wf_reviewCycle > 1)taskInstance.description = taskInstance.description + " (" + wf_reviewCycle + ")";
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
      </task>

      <transition name="approve" to="submitserialreview">
         <script>
            <variable name="wf_approveCount" access="read, write"/>
            <expression>
               wf_approveCount = wf_approveCount + 1;
            </expression>
         </script>
      </transition>
      <transition name="reject" to="endreview" />
   </task-node>


   <!–                –>
   <!– End the Review –>
   <!–                –>

   
   <decision name="endreview">
      <transition name="rejected" to="rejected" />
      <transition to="end" name="to end">
         <condition>#{wf_approveCount == wf_reviewerCount}</condition>
      </transition>
   </decision>
     
   <task-node name="rejected">
      <task name="wf:rejectedSerialTask" swimlane="initiator" >
         <event type="task-assign">
            <script>
               if (wf_reviewCycle > 1)
               taskInstance.description = taskInstance.description + " (" + wf_reviewCycle + ")";
            </script>
         </event>
      </task>
      <transition name="abort" to="end" />
      <transition name="resubmit" to="initialise">
         <!– restart review process (next cycle) –>
         <script>
            <variable name="wf_reviewCycle" access="read,write" />
            <expression>
               wf_reviewCycle = wf_reviewCycle +1;
            </expression>
         </script>
      </transition>
   </task-node>

   <!–                 –>
   <!– End the Process –>
   <!–                 –>

   <end-state name="end"/>

   <event type="process-end">
      <script>
         <!–                 –>
      </script>
   </event>

</process-definition>
2.serial-messages.properties (uploaded to : Company Home > Data Dictionary > Messages)

#     Filename: web-client-config-custom.xml
#     Description: This altered file describes additional entries for the serial review workflow
#     Usage: Upload file to : Company Home > Data Dictionary > Messages
#     Version: Alfresco Community 3.3
#     Author: Karel Jordaan
   
#
# Serial Review Workflow
#

wf_serialreview.workflow.title=Serial Review & Approve
wf_serialreview.workflow.description=Serial Review & approval of content

# Serial Review & Approve Task Definitions

wf_workflowmodel.type.wf_submitSerialReviewTask.title=Start Serial Review
wf_workflowmodel.type.wf_submitSerialReviewTask.description=Submit documents for review & approval to a list of people
wf_workflowmodel.property.wf_requiredApprovePercent.title=Required approval percentage
wf_workflowmodel.property.wf_requiredApprovePercent.description=Percentage of reviewers who must approve for approval
wf_workflowmodel.type.wf_rejectedSerialTask.title=Rejected
wf_workflowmodel.type.wf_rejectedSerialTask.description=Rejected
wf_workflowmodel.type.wf_approvedSerialTask.title=Approved
wf_workflowmodel.type.wf_approvedSerialTask.description=Approved
wf_workflowmodel.property.wf_reviewerCount.title=Number of reviewers
wf_workflowmodel.property.wf_reviewerCount.description=Number of reviewers

wf_workflowmodel.property.wf_approveCount.title=Reviewers who approved
wf_workflowmodel.property.wf_approveCount.description=Reviewers who approved


wf_reviewers=Reviewers
3.web-client-config-custom.xml (updated and uploaded to : Company Home > Data Dictionary > Web Client Extension)

<alfresco-config>
   <!–  Filename: web-client-config-custom.xml
     Description: This altered file describes additional entries for the serial review workflow
     Usage: Upload file to : Company Home > Data Dictionary > Web Client Extension
     Version: Alfresco Community 3.3
     Author: Karel Jordaan
    –>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <!–
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>
   –>
  
   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>


   <config evaluator="node-type" condition="wf:submitSerialReviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="wf_review_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="wf_review_due_date" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignees" display-label-id="wf_reviewers" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="wf:rejectedSerialTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignees" display-label-id="wf_reviewers" read-only="true"/>
      </property-sheet>
   </config>

</alfresco-config>
4.workflowModel.xml (updated in : \Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow)\

<?xml version="1.0" encoding="UTF-8"?>
<!–  Filename: workflowModel.xml
     Description: This altered file describes additional entries for the serial review workflow
     Usage: Overwrite the existing workflowModel.xml file in \Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\workflow
     Version: Alfresco Community 3.3
     Author: Karel Jordaan
–>

<model name="wf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
   </namespaces>
     
   <types>

      <!–                               –>
      <!–  Basic Review & Approve Tasks –>              
      <!–                               –>
     
      <type name="wf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:submitConcurrentReviewTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:requiredApprovePercent">
                <type>d:int</type>
                <mandatory>true</mandatory>
                <default>50</default>
                <constraints>
                    <constraint type="MINMAX">
                        <parameter name="minValue"><value>1</value></parameter>
                        <parameter name="maxValue"><value>100</value></parameter>
                    </constraint>
                </constraints>
            </property>
         </properties>
      </type>

      <!–  Submit review to multiple people (explicit list) –>
      <type name="wf:submitParallelReviewTask">
         <parent>wf:submitConcurrentReviewTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>
      <!–  This is the added type for serial review workflow –>
      <!–  Submit Serial review to multiple people (explicit list) –>
      <type name="wf:submitSerialReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>

      <!–  Submit review to multiple people (as included in a group) –>
      <type name="wf:submitGroupReviewTask">
         <parent>wf:submitConcurrentReviewTask</parent>
         <mandatory-aspects>
            <aspect>bpm:groupAssignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:reviewTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:approvedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <!–  This is the added type for serial review workflow –>
      <type name="wf:approvedSerialTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>
     
      <type name="wf:rejectedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <!–  This is the added type for serial review workflow –>
      <type name="wf:rejectedSerialTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>
     
      <type name="wf:rejectedParallelTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>wf:parallelReviewStats</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:approvedParallelTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>wf:parallelReviewStats</aspect>
         </mandatory-aspects>
      </type>


      <!–                               –>
      <!–  Adhoc Tasks –>              
      <!–                               –>
     
      <type name="wf:submitAdhocTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:adhocTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:completedAdhocTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
       
      <!– Deprecated workflow task from Alfresco 3.0 –>
      <!– Needs to be defined for patch.InvitationMigration which gets rid of it.  –>
     
      <type name="wf:inviteToSiteTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:serverPath">
               <type>d:text</type>
            </property>
            <property name="wf:acceptUrl">
               <type>d:text</type>
            </property>
            <property name="wf:rejectUrl">
               <type>d:text</type>
            </property>
            <property name="wf:inviteTicket">
               <type>d:text</type>
            </property>
            <property name="wf:inviterUserName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeUserName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeFirstName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeLastName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeGenPassword">
               <type>d:text</type>
            </property>
            <property name="wf:siteShortName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeSiteRole">
               <type>d:text</type>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

   </types>
  
   <aspects>
  
      <aspect name="wf:parallelReviewStats">
         <properties>
            <property name="wf:reviewerCount">
               <type>d:int</type>
            </property>
            <property name="wf:requiredPercent">
               <type>d:int</type>
            </property>
            <property name="wf:approveCount">
               <type>d:int</type>
            </property>
            <property name="wf:actualPercent">
               <type>d:int</type>
            </property>
         </properties>
      </aspect>
  
   </aspects>

</model>
5. Javascript file for execution of workflow implimented via a rule

<!–  Filename: serial_review_rule.js
     Description: This file describes how to execute a workflow from script
     Usage: Can be used as a rule when a document arrives in a folder to start the workflow on that document
     Version: Alfresco Community 3.3
     Author: Karel Jordaan
–>

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:serialreview";
workflow.parameters.requiredApprovePercent = 100;
workflow.parameters["bpm:workflowDescription"] = "Please review and approve: " + document.name;
<!– ParallelReviewUserOne has to be created  –>
workflow.parameters["bpm:assignees"] = [people.getPerson("admin"), people.getPerson("SerialReviewUserOne")];
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);

Enjoy

pp20218
Champ in-the-making
Champ in-the-making
Hey did it solve your requirement.Even I am facing the same problem.

mirkomane
Champ in-the-making
Champ in-the-making
Hi,

I found the error (thanks to good old grep) and post it here not only for myself but for others to use as well. All five code files can be found below.

The solution is to:
1. rename wf:rejectedTask in the serialreview_processdefinition.xml file to wf:rejectedSerialTask
2. and to add an additional type "wf:rejectedSerialTask" in the workflowModel.xml file

as shown below.

<task-node name="rejected">
      <task name="wf:rejectedTask" swimlane="initiator" >

<task-node name="rejected">
      <task name="wf:rejectedSerialTask" swimlane="initiator" >

Here are the files needed to get serial review working

Dear userfresco,
thank you for your efforts, your tips are very useful. I try to follow your istructions and so workflow working properly.
However, when the user receive the rejected task and click to "resubmit" button, the following message is shown:
Please correct the errors below then click OK.

    * A system error happened during the operation: 01060007 Failed to signal transition resubmit from workflow task jbpm$14.
Have you any ideas about the error?
Anyone want to help me is welcome!
Thank you very much!

mirkomane
Champ in-the-making
Champ in-the-making
Dear userfresco,
thank you for your efforts, your tips are very useful. I try to follow your istructions and so workflow working properly.
However, when the user receive the rejected task and click to "resubmit" button, the following message is shown:
Please correct the errors below then click OK.

    * A system error happened during the operation: 01060007 Failed to signal transition resubmit from workflow task jbpm$14.
Have you any ideas about the error?
Anyone want to help me is welcome!
Thank you very much!

I found the solution to the error above. Checking the tomcat log file reported:

org.jbpm.JbpmException: transition 'resubmit' doesn't have destination. check your processdefinition.xml

I have correct the rejected task node with the following:


<task-node name="rejected">
      <task name="wf:rejectedSerialTask" swimlane="initiator" >
         <event type="task-assign">
            <script>
               if (wf_reviewCycle > 1)
               taskInstance.description = taskInstance.description + " (" + wf_reviewCycle + ")";
            </script>
         </event>
      </task>
      <transition name="abort" to="end" />
      <transition name="resubmit" to="startreview">
         <!– restart review process (next cycle) –>
         <script>
            <variable name="wf_reviewCycle" access="read,write" />
            <variable name="wf_approveCount" access="write"/>
            <expression>
               wf_reviewCycle = wf_reviewCycle +1;
               wf_approveCount = 0 ;
            </expression>
         </script>
      </transition>
   </task-node>

mirkomane
Champ in-the-making
Champ in-the-making
Testing workflow I have also noticed that the initiator that receives the rejected document back can't edit it before making "Resubmit".
So I have edited the workflowModel.xml as below:


<!–  This is the added type for serial review workflow –>
      <type name="wf:rejectedSerialTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>

willerco
Champ in-the-making
Champ in-the-making
That might be working too on my project. I just need to check if the error might be reported on my log. I just need to do some of those examples to know the lesser errors.

mirkomane
Champ in-the-making
Champ in-the-making
That might be working too on my project. I just need to check if the error might be reported on my log. I just need to do some of those examples to know the lesser errors.

Hi willerco,
please can you clarify what you have to do? I don't understand what you ask for. Maybe I can help you.

Mirko

rikyjake
Champ in-the-making
Champ in-the-making
It's wonderful that people add to this site!