cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an OOTB Aprove-Reject workflow that sends emails?

talking_bear
Champ in-the-making
Champ in-the-making
hello evbody

i read posts and did my homework. i am a newbie. the question is short:

are the OOTB Aprove/Review workflows supposed to send mails or should i add that myself? i am unsure if i am doing something wrong or the functionality is really not present.
the mails should say smth similar to the ones in the invitation template:
press this link to aprove …
press the other link to decline/reject …

before u ask: the system is sending mails correctly on other events (invitations for ex)

installation: 3.4a on centos 5.5

i also have a 3.2 installed on another centos for lab reasons but planning to bring everything to 3.4

i thank you an awful lot
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
No.   The ootb don't spam via email, although it would be an easy enhancement.

talking_bear
Champ in-the-making
Champ in-the-making
copy that. guess that answers the question. thank you.

so let's see if i got it right then:
on a 3.4 installation i would have to create a workflow using Eclipse,
create a task to send email
use Eclipse to deploy it: it should fall in in installation_dir/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow
create a script that could look like this in its simplest form:


    var workflow = actions.create("start-workflow");
    workflow.parameters.workflowName = "jbpm$alwf:my_workflow";
    workflow.execute(document);

upload it in the Data Dictionary/Scripts
define a rule in a space to launch the script on inbound documents: this way my workflow would be launched on any new document i would upload in my space

alternatively, i could modify an ootb to append the commands that would send the emails.
let's say for the purpose of this conversation that i would take
tomcat/webapps/alfresco/WEB-INF/classes/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" />
        <transition name="reject" to="rejected" />
    </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>

somewhere (probably in or right after the start) i would add the sending mail part

personally i would prefer the second option

how am i doing until now?