XpressUtils - Helping Sun Identity Management Professionals
   
 
Utilities
Tech Talk
Tip of the day
You can add attachments to emails sent out by IDM. Refer to the article specifically guiding on how to accomplish this.

Current Poll
Which product (arranged below in alphabetical order), do you think has the best features in the 'Identity & Access Management' space today?

CA IDM
IBM Tivoli
Novell IDM
Oracle (Sun) IDM
Others (please specify)

Comments:

View previous poll results

Articles / Forum - Creating Rule for Email Template

We hope you find the information below useful. This is a forum-thread. Feel free to provide your response and contribute to make this article better. Share, wiki and grow!
<< Back to all Articles

Creating Rule for Email Template Posted by Stephen
on Mar 05, 12:53 AM
Rate this article
1 of 52 of 53 of 54 of 55 of 5
  

Subscribe to updates


Hi,

I am trying to create a Rule through which my Workflow will choose a particular "Email Template", based on the value of a given attribute.

Here is the way my "Action" looks in my workflow :


<Action id='2' name='email1' application='com.waveset.provision.WorkflowServices'>
<Argument name='op' value='notify'/>
<Argument name='template'>
<rule name='My Rule Email Template'/>
</Argument>
<Argument name='to' value='michael.jackson@yahoo.com'/>
</Action>


And, here is the actual Rule (My Rule Email Template) :


<RuleArgument name='template'/>

<switch>

<ref>global.employmenttype</ref>
<case>
<s>Permanent Employment</s>
<setvar name='template'>
<s>Email Notify User Admin</s>
</setvar>
</case>
<case>
<s>Temporary Employment</s>
<setvar name='template'>
<s>Email Notify Account Admin</s>
</setvar>
</case>

</switch>

<MemberObjectGroups>
<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
</MemberObjectGroups>
</Rule>


In other words : if the attribute "Temporary Employment" is chosen from the User Form, then my workflow will select "Email Notify Account" as the Email Template to use.

If "Permanent Employment" is chosen, then it will select the other Email Template.


However, when I tried to test this, I got the error :

JavaLang Error : Null Exception


Obviously, my Rule is faulty.

Please, could anyone tell me where my mistake is?

Thanks

Your Ad Here

Creating Rule for Email Template Posted by Adi
on Mar 17, 05:05 PM
   
The rule is returning null... why? Because the <set> or <setvar> tags return null (even though they set the variable value).

If you write it this way instead, the rule should be good to use:

<block>
    <defvar name='template'>
        <switch>
            <ref>global.employmenttype</ref>
            <case>
                <s>Permanent Employment</s>
                <s>Email Notify User Admin</s>
            </case>
            <case>
                <s>Temporary Employment</s>
                <s>Email Notify Account Admin</s>
            </case>
        </switch>
    </defvar>
    <ref>template</ref>
</block>


  

The views expressed in this article are solely those of its contributor(s) and are not necessarily endorsed by xpressutils.com. << Back to all Articles


Feedback

Feedback / Comments:

We value comments from XpressUtils users! We strive to make this site better for you each day, so all constructive comments are appreciated.
Please feel free to send us your feedback!
 
From: Achin Aug 30, 07:48 AM
Comment Hi, team i want to know how to add uid to LDAP groups. if any body knows please help
From: mike Aug 25, 09:08 AM
Comment Can you give an example to use this rule? What does it mean "The trick to achieve this is use the "P ...
From: ajay nalawade Jul 29, 08:43 AM
Comment i want information about how to call java from expree boolean isConnectionSuccessful=connectDB.co ...
From: Carrie Cain Jul 24, 05:22 AM
Comment Want more clients and customers? We will help them find you by putting you on the 1st page of Google ...
From: nimish Jul 20, 12:53 AM
Comment In Handy Tools, Test Regular Expressions is not working. anybody used it?
From: nimish Jul 13, 02:18 AM
Comment hi team, I have some problem related to configure openSSO. Can I ask you for this or should I go to ...
From: Anirudha Jul 13, 01:41 AM
Comment Wish you all the best...
From: hussain Jun 05, 06:59 AM
Comment Could u please provide an ebook for Sun Certified Integrator for Identity Manager 7.1
From: docsnyder May 07, 05:52 AM
Comment Hi! I have downloaded the rule tester JSP file and followed the instructions, but the following err ...
From: jagadisham Mar 21, 12:48 PM
Comment day by day it is improving...all the best!!!
View all comments >>

Submit a comment:

Name: required
E-mail: required
Comments: required
Submit Comments
Tip: If you have a question related to programming in Xpress or some functionality in IDM, please post it as a new article in the Articles section.

It's quick, easy and does not require you to sign-up too!
 
    Home | Terms of use | Contact us | Help    
  Copyright © 2008-2009 XpressUtils.com. All rights reserved.