Alfresco provides an inbuilt Web Site Submission workflow to be associated with the web project. If you want to make change in the existing workflow, following are the location of the files to make the changes.
<install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow/submit_processdefinition.xml.
<install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow/wcmWorkflowModel.xml.
<install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow/wcm-workflow-messages.properties.
<install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/bootstrap-context.xml.
<install-alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config-properties.xml.
Consider a case where you want to add an e-mail notification at the submission of content. It is easy to customize the workflow by adding the following code snippet that is highlighted:
<task name="wcmwf:submittedTask" swimlane="initiator">
<timer duedate="5 seconds" transition="onsubmit">
<action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("WCM Submit Process: Triggering submit for " + bpm_workflowDescription);
</script>
</action>
</timer>
<event type="task-end">
<script>
<variable name="submitfailed" access="write"/>
<expression>submitfailed = false;</expression>
</script>
<action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
</script>
</action>
<action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Submit Task " + bpm_workflowDescription;
mail.parameters.from = person.properties.email;
mail.parameters.text = "It's done";
mail.execute(bpm_package);
</script>
</action>
<action class= "org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
<action class="org.alfresco.repo.avm.wf.AVMDeployHandler"/>
<action class= "org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("WCM Submit Process: End submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
</script>
</action>
</event>
</task>
Deploy the Process Definition using a dynamic approach and test the workflow.
If you want to deploy changes manually, you have to make changes in the bootstrap-context.xml
file as mentioned previously in the fourth point.
<props> <!-- WCM workflow definition --> <prop key="engineId">jbpm</prop> <prop key="location"> alfresco/workflow/submit_processdefinition.xml</prop> <prop key="mimetype">text/xml</prop> <prop key="redeploy">true</prop> </props>
You should receive an e-mail notification at the submission of content to the Staging box.