February 23, 2012 3:12:34 AM PST
Goal: How to Create A Custom Email Notification for Task Assignment Fact: Interstage BPM (Business Process Manager) v7.4 AE (Advanced Edition) Fact: MS SQL Server 2005 Fact: Windows XP Professional Service Pact 3 Fact: Microsoft Active Directory Fix:This article explains 1. How to retrieve the activity assignees by using Interstage BPM predefined JavaScript function, getActivityAssignees() that returns a comma separated string value. 2. How to retrieve email from a properties file based on a given user ID in Active Directory. 3. How to use JavaScript to construct a custom email notification message to be sent out via Interstage BPM predefined JavaScript function, sendEmail(). Follow the instructions below to see a working sample template as attached.Step 1: Download EmailRetrievalFromFileAndSendCustomEmail.zip Step 2: Locate the .xpdl file after extracting the zip file into your local file system. Import it using Interstage BPM console. Step 3: The default role defined for the only activity node is "role". Change to appropriate role that is available in your directory service. Step 4: Save the InterstageBPMHelperOperations.class into {Interstage BPM install dir}classes. InterstageBPMHelperOperations.java can be found inside the zip file. Step 5: Save Emails.properties file into {Interstage BPM install dir}classes or your chosen directory. Update the properties file to add the needed ID and email address pair. Step 6: Edit the rolescript of the only activity node to reflect the absolute path to Emails.properties created in step 5.Specifically, change the following statement: var
emailAddresses = ibpmOp.getUsersEmails("c:\fujitsu\interstagebpm\classes\Emails.properties",assignees);
Step 7: The rolescript is where you would construct the custom contents of the email notifications.
Follow the comments in the rolescript to edit wherever is deemed appropriate.
Step 8. Restart BPM server for the server JVM to pick up the custom java class as mentioned in step 4.
Step 9: Launch a new process from the process definition imported in step 1.
Check to see if you have received the email notification to the assignees.
Author: C.Y. Chen
Attachment: EmailRetrievalFromFileAndSendCustomEmail.zip