04-09-2010 11:48 AM
04-14-2010 07:31 PM
04-15-2010 10:54 AM
04-15-2010 11:03 AM
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:review2">
<swimlane name="initiator" />
<start-state name="start">
<task name="wf:submitReviewTask" swimlane="initiator"/>
<transition name="inReview" to="node1">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_package" access="read" />
<expression>
bpm_package.children[0].properties["custom:statutdocument"] = "En relecture";
bpm_package.children[0].save();
</expression>
</script>
</action>
</transition>
</start-state>
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<node name="node1">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_package" access="read" />
<variable name="bpm_assignee" access="read" />
<expression>
<!– Send a notification email to the reviewer–>
var mail = actions.create("mail");
mail.parameters.from = "thomasberment@gmail.com";
mail.parameters.to = bpm_assignee.properties.email;
mail.parameters.subject = "New Review Task";
<!–mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");–>
mail.parameters.text = "A document awaiting your approval at Alfresco";
mail.execute(bpm_package.children[0]);
</expression>
</script>
</action>
<transition to="review"></transition>
</node>
<task-node name="review">
<task name="wf:reviewTask" swimlane="reviewer">
<event type="task-create">
<script>
<variable name="bpm_package" access="read" />
<variable name="bpm_assignee" access="read" />
<expression>
if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
</expression>
</script>
</event>
</task>
<transition name="reject" to="rejected">
</transition>
<transition name="approve" to="approved">
</transition>
</task-node>
<task-node name="rejected">
<task name="wf:rejectedTask" swimlane="initiator" />
<transition name="" to="end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_package" access="read" />
<expression>
bpm_package.children[0].properties["custom:statutdocument"] = "Travail";
bpm_package.children[0].save();
</expression>
</script>
</action>
</transition>
</task-node>
<task-node name="approved">
<task name="wf:approvedTask" swimlane="initiator" />
<transition name="" to="end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_package" access="read" />
<expression>
bpm_package.children[0].properties["custom:statutdocument"] = "Relu";
bpm_package.children[0].save();
</expression>
</script>
</action>
</transition>
</task-node>
<end-state name="end" />
</process-definition>
###############################
## Common Alfresco Properties #
###############################
#
# Sample custom content and index data location
#————-
dir.root=C:/Alfresco/alf_data
#
# Sample database connection properties
#————-
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=3306
#
# External locations
#————-
ooo.exe=C:/Alfresco/OpenOffice.org/program/soffice
ooo.user=C:/Alfresco/alf_data/oouser
img.root=C:/Alfresco/ImageMagick
swf.exe=C:/Alfresco/bin/pdf2swf
#
# Initial admin password
#————-
alfresco_user_store.adminpassword=209c6174da490caeb422f3fa5a7ae634
#
# MySQL connection
#————-
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://${db.host}:${db.port}/${db.name}
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
#
# Index Recovery Mode
#————-
#index.recovery.mode=Auto
#
# Outbound Email Configuration
#————-
# Sample Gmail settings
mail.host=smtp.gmail.com
mail.port=465
mail.protocol=smtps
mail.username=thomasberment@gmail.com
mail.password=************
mail.encoding=UTF-8
mail.smtp.socketFactory.port = 465
mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback = false
mail.smtp.timeout = 25000
# New Properties
mail.smtps.starttls.enable=true
mail.smtps.auth=true
#
# Alfresco Email Service and Email Server
#————-
# Enable/Disable the inbound email service. The service could be used by processes other than
# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service.
#————-
#email.inbound.enabled=true
# Email Server properties
#————-
#email.server.enabled=true
#email.server.port=25
#email.server.domain=alfresco.com
#email.inbound.unknownUser=anonymous
# A comma separated list of email REGEX patterns of allowed senders.
# If there are any values in the list then all sender email addresses
# must match. For example:
# .*\@alfresco\.com, .*\@alfresco\.org
# Allow anyone:
#————-
#email.server.allowed.senders=.*
#
# The default authentication chain
# To configure external authentication subsystems see:
# http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems
#————-
#authentication.chain=alfrescoNtlm1:alfrescoNtlm
#
# IMAP
#————-
#imap.server.enabled=true
#imap.server.port=143
#imap.server.host=localhost
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– –>
<!– MAIL SERVICE –>
<!– –>
<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host">
<value>${mail.host}</value>
</property>
<property name="port">
<value>${mail.port}</value>
</property>
<property name="protocol">
<value>${mail.protocol}</value>
</property>
<property name="username">
<value>${mail.username}</value>
</property>
<property name="password">
<value>${mail.password}</value>
</property>
<property name="defaultEncoding">
<value>${mail.encoding}</value>
</property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
<prop key="mail.smtp.socketFactory.port">${mail.smtp.socketFactory.port}</prop>
<prop key="mail.smtp.socketFactory.class">${mail.smtp.socketFactory.class}</prop>
<prop key="mail.smtp.socketFactory.fallback">${mail.smtp.socketFactory.fallback}</prop>
<prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
</props>
</property>
</bean>
</beans>
04-15-2010 12:05 PM
# Sample Gmail settings
mail.host=smtp.gmail.com
mail.port=465
mail.protocol=smtps
mail.username=user@gmail.com
mail.password=password
# New Properties
mail.smtps.starttls.enable=true
mail.smtps.auth=true
04-16-2010 08:46 AM
04-16-2010 02:03 PM
04-20-2010 05:16 PM
<start-state name="start">
<task name="wf:submitReviewTask" swimlane="initiator" />
<transition name="" to="review">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
<!– Send a notification email to the reviewer –>
var mail = actions.create("mail");
mail.parameters.to = bpm_assignee.properties.email;
mail.parameters.subject = "new Review Task";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/notify_user_email.ftl");
mail.parameters.text = "A document awaiting your approval at Alfresco";
mail.execute(bpm_package.children[0]);</script>
</action>
</transition>
</start-state>
04-20-2010 05:20 PM
Hi, I tried many solutions to send an Email, but it never works !
I thought of something, I have a proxy. Is it possible that this is my problem ?
04-21-2010 04:48 PM
Hi Durrell, I need to write code to send emails too… so I wanted to use something that we know works already. I modified review_processdefinition.xml with the code we were discussing before, but it is not working for me. My email configuration is set up correctly. Did you have to do anything else to review_processdefinition.xml in order to get it to work? Also, this process is kicked off when you click "Advanced Workflow" -> "Review & Approve (Review & approval of content)", right?
04-21-2010 04:58 PM
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.