IDM Workflows Services

Gabriel Magariño, gabriel.magarino@gmail.com, Sun Java System Identity Manager, www.javapassion.com/idm


Gabriel Magariño

Expected duration: 25 minutes (excluding homework)


Prerequisites

This hands-on lab assumes you have minimum programming experience.


Software Needed


Before you begin, you need to install the following software on your computer. 



OS platforms you can use


Change Log

Lab Exercises



Exercise 0: Enable User Workflow  Service


                The goal of this exercise is to let you experience about how to use a Workflow services in your custom workflow.


  1. Enable User

(0.1) Enable User



  1. Create a new IDM remote project under the folder  C:\IDM\Projects\Lab-010
  2. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Enable workflow services, this operation will allow you enable any user in idm
Workflow IDM_COURSE_WFP_WorkflowService Enable  User 1   Download
Comments
Bold Code
Workflow.

Activity id= 1. Shows the activity used to call the Enable User

Action id = 0. Shows you under the application parameter the name of the java class used by idm to enable user

Argument op. Is used to specify the worflow services that we are using.

Argument accountId. Is used to specify the user who will be enabled. You can use any other calculated expression using Xpress

Argument doWaveset. Is used to specify if we should enable or not the idm account ID. Remember lighthouse is the name of tha account id for the IDM itself. true=enable, false = no enable. This is very usefull when the user has more than one resource assigned.

CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Mon Feb 04 23:37:57 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Enable  User 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Enable  User 1' creator='Configurator' createDate='1202189877281' lastModifier='Configurator' lastModDate='1203787774890' lastMod='12' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Enable  User 1' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Enable User'/>
                <WorkflowEditor x='59' y='84'/>
            </Activity>
           
            <Activity id='1' name='Enable User'>
                <Action id='0' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='enableUser'/>
                    <Argument name='accountId' value='999012'/>
                    <Argument name='doWaveset' value='true'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='264' y='148'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='476' y='126'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>


  1. The image below shows you the structure that your netbeans project should have and which is the parameter that we are going to be modifying for this exercise.



  1. We need to create a user with  a lighthouse account disable
  2. Select Accounts
  3. Select Launch Bulk Actions
  4. Select the Launch Button




  1. A user 99012 will appears disabled (red mark) and we are going to proceed with the enable operation using a workflow (see image below).





  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute IDM_COURSE_WFP_WorkflowService Enable  User 1
  4. A Task Results Page appears (see the image below)
  5. Select OK button



  1. Select Accounts
  2. Select List Account
  3. As you can see in the image below the user is now enable again in IDM that will allow the user execute idm operations.




                                                                                                                    return to the top


Exercise 1: Disable User Workflow  Service


                The goal of this exercise is to let you experience about how to use the disable Workflow services in your customized workflows.
  1. Disable User

(1.1) Disable User



  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Disable workflow services, this operation will allow you disable any user in idm
Workflow IDM_COURSE_WFP_WorkflowService Disable  User 1   Download
Comments
Bold Code
Workflow.

Activity id= 1. Shows the activity used to call the Disable User

Action id = 0. Shows you under the application parameter the name of the java class used by idm to disable an user

Argument op. Is used to specify the worflow services that we are using.

Argument accountId. Is used to specify  the user who will be enabled. You can use any other calculated expression using Xpress

Argument doWaveset. Is used to specify if we should disable or not the idm account ID.

CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Mon Feb 04 23:31:24 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Disable  User 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Disable  User 1' lock='Configurator#1206257862781' creator='Configurator' createDate='1202189484250' lastModifier='Configurator' lastModDate='1206257562718' lastMod='13' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Disable  User 1' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Disable User'/>
                <WorkflowEditor x='59' y='84'/>
            </Activity>
           
            <Activity id='1' name='Disable User'>
                <Action id='0' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='disableUser'/>
                    <Argument name='accountId' value='999010'/>
                    <Argument name='doWaveset' value='true'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='274' y='54'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='476' y='126'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>



  1. Select the Accounts Menu
  2. Select List Accounts Menu (see image below)
     

      

  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute  IDM_COURSE_WFP_WorkflowService Disable  User 1
  4. A Task Result  page appears (see the image below)

      

  1. Select Accounts.
  2. Select List Accounts


      


Exercise 2: Delete User Workflow  Service


                The goal of this exercise is to let you experience about how to use the delete Workflow services in your customized workflows.


  1. Delete User

(2.1) Delete User




  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Delete workflow services, this operation will allow you delete any user in idm
Workflow IDM_COURSE_WFP_WorkflowService Delete  User 1   Download
Comments
Bold Code
Workflow.

Activity id= 1. Shows the activity used to call the Delete User

Action id = 0. Shows you under the application parameter the name of the java class used by idm to delete  an user

Argument op. Is used to specify the worflow services that we are using.

Argument accountId. Is used to specify the user who will be deleted. You can use any other calculated expression using Xpress

CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Sun Feb 17 14:17:53 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Delete  User 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Delete  User 1' lock='Configurator#1206259007890' creator='Configurator' createDate='1203279473890' lastModifier='Configurator' lastModDate='1206258707828' lastMod='8' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Delete  User 1' maxSteps='0'>
            <Variable name='accountId' value='999010'/>
           
            <Activity id='0' name='start'>
                <Transition to='Delete User'/>
                <WorkflowEditor x='59' y='84'/>
            </Activity>
           
            <Activity id='1' name='Delete User'>
                <Action id='0' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='deleteUser'/>
                    <Argument name='accountId' value='$(accountId)'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='276' y='56'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='476' y='126'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>


  1. Select the Accounts Menu
  2. Select List Accounts Menu (see image below)
         
      

  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute  IDM_COURSE_WFP_WorkflowService Delete User 1
  4. A Task Result  page appears (see the image below)

     

  1. Select Accounts.
  2. Select List Accounts

      

  1. If you try to execute againg the delete workflow you will receive an error like the image  below
  2. Click the Launch Button

      


  1. Click the Server Tasks Menu and Run Tasks to continue the exercises


      



Exercise 3: Create View User Workflow  Service


                The goal of this exercise is to let you experience about how to use a create view Workflow services in your customized workflows.

  1. Create View User  View

(3.1) Create View  User View


  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Create View workflow services, this operation will allow you create an user in idm when you use the User View as a Parameter
Workflow IDM_COURSE_WFP_WorkflowService Create View 1   Download
Comments
Bold Code
Workflow.


The nex code is used to define the variables content for the user to be created.

<Variable name='accountId' value='999010'/>


Activity id= 1. Shows the activity used to call the Create User

Action id = 0. Shows you under the application parameter the name of the java class used by idm to create a  view

  Argument op. Is used to specify  the worflow services that we are using.
  Argument type. Is used to specify the view we want to create
  Argument accountId. Is used to specify the user who will be created. You 
                                     can use any other calculated expression using Xpress


Action id = 1. Is used to  set the values for the user view, we are using the path expression to set  to the view values



Action id = 2 .  Is a workflow services used to provision accounts in IDM.

newViewUser contains the user view values to be created
 

CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Mon Feb 04 23:01:59 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Create View 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Create View 1' lock='Configurator#1206259434718' creator='Configurator' createDate='1202187719296' lastModifier='Configurator' lastModDate='1206259134640' lastMod='32' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Create View 1' maxSteps='0'>
            <Variable name='accountId' value='999010'/>
            <Variable name='firstName' value='Malcom'/>
            <Variable name='lastName' value='Young'/>
            <Variable name='password' value='pa55w0rd'/>
            <Variable name='email' value='malcom.young@idm.com'/>
           
            <Activity id='0' name='start'>
                <Transition to='Create User'/>
                <WorkflowEditor x='59' y='84'/>
            </Activity>
           
            <Activity id='1' name='Create User'>
                <Action id='0' name='Create a View for the User' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='createView'/>
                    <Argument name='type' value='User'/>
                    <Argument name='id' value='$(accountId)'/>
                    <Argument name='viewId' value='User'/>
                </Action>
                <Action id='1' name='Set the values for the View'>
                    <expression>
                        <block>
                            <set name='user.global.accountId'>
                                <ref>accountId</ref>
                            </set>
                            <set name='user.global.password'>
                                <ref>password</ref>
                            </set>
                            <set name='user.global.firstname'>
                                <ref>firstName</ref>
                            </set>
                            <set name='user.global.lastname'>
                                <ref>lastName</ref>
                            </set>
                            <set name='user.global.fullname'>
                                <concat>
                                    <ref>firstName</ref>
                                    <s> </s>
                                    <ref>lastName</ref>
                                </concat>
                            </set>
                            <set name='user.global.email'>
                                <ref>email</ref>
                            </set>
                        </block>
                    </expression>
                </Action>
                <Action id='2' name='Provisioning User' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='provision'/>
                    <Argument name='user' value='$(newViewUser)'/>
                    <Argument name='noCreate' value='false'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='278' y='54'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='476' y='126'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>


       
  1. Select the Accounts Menu
  2. Select List Accounts Menu (see image below)
         

      


  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute  IDM_COURSE_WFP_WorkflowService Create View 1
  4. A Task Result  page appears (see the image below)



      

  1. Select Accounts.
  2. Select List Accounts
  3. Click under the 999010 link

      

      
  1. The Edit User page appears (see the image below)

      


                                                                                                                    return to the top


Exercise 4: Email Workflow  Service


                The goal of this exercise is to let you experience about how to use a Workflow services in your custom workflows.
  1. Email Workflow Service (Full Example)
  2. Email Basic
  3. Email with variables
  4. Email Enabling HTML
  5. Email Enabling HTML & CSS

(4.1)Email Workflow Service (Full Example)



  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Notify workflow services, this operation will allow you send emails thru idm
Workflow IDM_COURSE_WFP_WorkflowService Email 1   Download
Email Template
IDM_COURSE_EMT_WorkflowService Email 1    Download
Comments
Bold Code
Workflow.

Activity id= 2. Shows the activity used to call the notify workflow service

Action id = 0. Shows you under the application parameter the name of the java class used by idm to use the notify workflow service.


Argument template. Is used to specify the email template.




CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Sat Feb 09 00:35:13 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Email 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Email 1' lock='Configurator#1206261056406' creator='Configurator' createDate='1202538913906' lastModifier='Configurator' lastModDate='1206260756343' lastMod='14' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Email 1' maxSteps='0'>
            <Variable name='accountId' value='999010'/>
            <Variable name='firstName' value='Malcom'/>
            <Variable name='lastName' value='Malcom'/>
            <Variable name='password' value='pa55w0rd'/>
            <Variable name='email' value='malcom.young@idm.com'/>
           
            <Activity id='0' name='start'>
                <Transition to='Create User'/>
                <WorkflowEditor x='43' y='10'/>
            </Activity>
           
            <Activity id='1' name='end'>
                <WorkflowEditor x='216' y='10'/>
            </Activity>
           
            <Activity id='2' name='Send Notification'>
                <Action id='0' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='notify'/>
                    <Argument name='template' value='IDM_COURSE_EMT_WorkflowService Email 1'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='153' y='128'/>
            </Activity>
           
            <Activity id='3' name='Create User'>
                <Action id='0' name='Create a View for the User' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='createView'/>
                    <Argument name='type' value='User'/>
                    <Argument name='id' value='$(accountId)'/>
                    <Argument name='viewId' value='User'/>
                </Action>
                <Action id='1' name='Set the values for the View'>
                    <expression>
                        <block>
                            <set name='user.global.accountId'>
                                <ref>accountId</ref>
                            </set>
                            <set name='user.global.password'>
                                <ref>password</ref>
                            </set>
                            <set name='user.global.firstname'>
                                <ref>firstName</ref>
                            </set>
                            <set name='user.global.lastname'>
                                <ref>lastName</ref>
                            </set>
                            <set name='user.global.fullname'>
                                <concat>
                                    <ref>firstName</ref>
                                    <s> </s>
                                    <ref>lastName</ref>
                                </concat>
                            </set>
                            <set name='user.global.email'>
                                <ref>email</ref>
                            </set>
                        </block>
                    </expression>
                </Action>
                <Action id='2' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='provision'/>
                    <Argument name='user' value='$(newViewUser)'/>
                    <Argument name='noCreate' value='false'/>
                </Action>
                <Transition to='end'>
                    <eq>
                        <ref>WF_ACTION_ERROR</ref>
                        <s>true</s>
                    </eq>
                </Transition>
                <Transition to='Send Notification'/>
                <WorkflowEditor x='116' y='10'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

 
  1.  Delete the user  999010 created in the previous exercise
  2. Select the Server Tasks
  3. Select Run Tasks
  4. Select the workflow to execute  IDM_COURSE_WFP_WorkflowService Email 1
  5. A Task Result  page appears (see the image below)

      

  1.       Go to your notifications folder and you will have an email  with the 999010 was created as a msgBody. (see the image below)
      • For the course purpouse we are  using th c:\idm\notifications\notifications.txt


      



(4.2)Email Basic



  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow used to send an email template, basic functionality
Workflow IDM_COURSE_WFP_WorkflowService Email 2   Download
Email Template
IDM_COURSE_EMT_WorkflowService Email 2    Download
Comments
Bold Code
Workflow.

The Activity 1 is used to call the notify workflow service(op=notify). The Argument template is used to especify the email template.

Email Template
.

The body tag is used to  define the content of the email to be sent by IDM.



CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Tue Apr 15 10:01:58 CDT 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Email 2" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Email 2' lock='Configurator#1208277820062' creator='Configurator' createDate='1208271718500' lastModifier='Configurator' lastModDate='1208277520031' lastMod='4' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
  <Extension>
    <WFProcess name='IDM_COURSE_WFP_WorkflowService Email 2' maxSteps='0'>

      <Activity id='0' name='start'>
        <Transition to='Email Notification'/>
        <WorkflowEditor x='43' y='10'/>
      </Activity>

      <Activity id='1' name='Email Notification'>
        <Action id='0' name='Send email' application='com.waveset.provision.WorkflowServices'>
          <Argument name='op' value='notify'/>
          <Argument name='template' value='IDM_COURSE_EMT_WorkflowService Email 2'>
            <Comments>&#xA;      The name of an Email Template object in the Lighthouse repository.  &#xA;      This describes the structure of the email and may include references&#xA;      to workflow variable or arguments specified in the call.&#xA;    </Comments>
            <String>IDM_COURSE_EMT_WorkflowService Email 2</String>
          </Argument>
        </Action>
        <Transition to='end'/>
        <WorkflowEditor x='126' y='10'/>
      </Activity>

      <Activity id='2' name='end'>
        <WorkflowEditor x='204' y='10'/>
      </Activity>
    </WFProcess>
  </Extension>
  <MemberObjectGroups>
    <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
  </MemberObjectGroups>
</TaskDefinition>

Email Template
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE EmailTemplate PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" name="IDM_COURSE_EMT_WorkflowService Email 2"-->
<EmailTemplate name='IDM_COURSE_EMT_WorkflowService Email 2' lock='Configurator#1208277816390' creator='Configurator' createDate='1208272140984' lastModifier='Configurator' lastModDate='1208277516328' lastMod='5' smtpHost='localhost' fromAddress='idm.course@idm.com' toAddress='any.user@idm.com' htmlEnabled='true'>
    <subject>IDM with Passion Course</subject>
    <body>This is an example about how to use a basic email template</body>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</EmailTemplate>


  1. Click the Server Tasks tab at the top of the page
  2. Click the Run Tasks subtab on the left
  3. Click the workflow to execute  IDM_COURSE_WFP_WorkflowService Email 2
  4. A custom Task Results  page appears.  
  5. Go to your notifications folder and you will have an email. (see the image below)
    • For the course purpouse we are  using th c:\idm\notifications\notifications.txt







(4.3)Email with variables


  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow passing variables to the notification, including variables in the workflow,action and  the notification.
Workflow IDM_COURSE_WFP_WorkflowService Email 3   Download
Email Template
IDM_COURSE_EMT_WorkflowService Email 3    Download
Comments
Bold Code
Workflow.

We are declaring the variable applications  with a list of the applications "assigned" to the user. This variable is used later in the body notification.

Email Template.

We are declaring the variable appsOutIdm and  using the remove XPRESS function to eliminate the lighthouse account from the  list.



The body tag is used to  define the content of the email to be sent by IDM.

We are using the syntax $(variable) to get the value of it.





CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Tue Apr 15 11:37:38 CDT 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Email 3" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Email 3' creator='Configurator' createDate='1208277458968' lastModifier='Configurator' lastModDate='1208287450281' lastMod='4' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Email 3' maxSteps='0'>
            <Variable name='accountId' value='999010'/>
           
            <Activity id='0' name='start'>
                <Transition to='Email Notification'/>
                <WorkflowEditor x='43' y='10'/>
            </Activity>
           
            <Activity id='1' name='Email Notification'>
                <Action id='0' name='Send email' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='notify'/>
                    <Argument name='template' value='IDM_COURSE_EMT_WorkflowService Email 3'>
                        <Comments>&#xA;      The name of an Email Template object in the Lighthouse repository.  &#xA;      This describes the structure of the email and may include references&#xA;      to workflow variable or arguments specified in the call.&#xA;    </Comments>
                        <String>IDM_COURSE_EMT_WorkflowService Email 3</String>
                    </Argument>
                    <Variable name='applications'>
                        <List>
                            <String>Lighthouse</String>
                            <String>AD</String>
                            <String>Solaris</String>
                            <String>Oracle</String>
                            <String>Mainframe</String>
                        </List>
                    </Variable>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='126' y='10'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='204' y='10'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>


Email Template
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE EmailTemplate PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" name="IDM_COURSE_EMT_WorkflowService Email 3"-->
<EmailTemplate name='IDM_COURSE_EMT_WorkflowService Email 3' creator='Configurator' createDate='1208277505859' lastModifier='Configurator' lastModDate='1208287508546' lastMod='15' smtpHost='localhost' fromAddress='idm.course@idm.com' toAddress='any.user@idm.com'>
    <Variable name='appsOutIdm'>
        <remove>
            <ref>applications</ref>
            <s>Lighthouse</s>
        </remove>
    </Variable>
    <subject>IDM with Passion Course</subject>
    <body>This is an example about how to use a basic email template.&#xA;Showing information for the $(accountId) user.&#xA;All Applications assigned $(applications)&#xA;All Applications assigned removing IDM  application $(appsOutIdm)</body>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</EmailTemplate>


  1. Click the Server Tasks tab at the top of the page
  2. Click the Run Tasks subtab on the left
  3. Click the workflow to execute  IDM_COURSE_WFP_WorkflowService Email 3
  4. A custom Task Results page appears.  
  5. Go to your notifications folder and you will have an email. (see the image below)
    • For the course purpouse we are  using th c:\idm\notifications\notifications.txt






(4.4)Email Enabling HTML


  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow used to send an email template, basic functionality
Workflow IDM_COURSE_WFP_WorkflowService Email 4   Download
Email Template
IDM_COURSE_EMT_WorkflowService Email 4    Download
Comments
Bold Code
Email Template.

On the Email Template tag we are enabling the HTML content for the notification body changing the htmlEnabled='false'   to  htmlEnabled='true'

The body tag is used to  define the content of the email to be sent by IDM.

Inside the body we are inserting  HTML code to be  displayed in the notification.



CODE
Email Template

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE EmailTemplate PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" name="IDM_COURSE_EMT_WorkflowService Email 4"-->
<EmailTemplate name='IDM_COURSE_EMT_WorkflowService Email 4' lock='Configurator#1208293070421' creator='Configurator' createDate='1208287776765' lastModifier='Configurator' lastModDate='1208292770375' lastMod='4' smtpHost='localhost' fromAddress='idm.course@idm.com' toAddress='any.user@idm.com' htmlEnabled='true'>
    <Variable name='oneApps'>
        <get>
            <ref>appsOutIdm</ref>
            <s>1</s>
        </get>
    </Variable>
    <Variable name='appsOutIdm'>
        <remove>
            <ref>applications</ref>
            <s>Lighthouse</s>
        </remove>
    </Variable>
    <subject>IDM with Passion Course</subject>
    <body>&lt;&#33;&#68;OCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&#xA;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&#xA;&lt;head&gt;&#xA;&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;&#xA;&lt;title&gt;Untitled Document&lt;/title&gt;&#xA;&lt;/head&gt;&#xA;&#xA;&lt;body&gt;&#xA;&lt;h4 align="center"&gt;This is an example about how to use a basic email template with HTML.&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;  &lt;li&gt;Showing information for the $(accountId) user.&lt;/li&gt;&#xA;  &lt;li&gt;All Applications assigned $(applications)&lt;/li&gt;&#xA;  &lt;li&gt;All Applications assigned removing IDM  application $(appsOutIdm)&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/body&gt;&#xA;&lt;/html&gt;&#xA;&#xA;</body>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</EmailTemplate>


  1. Click the Server Tasks tab at the top of the page
  2. Click the Run Tasks subtab on the left
  3. Click the workflow to execute  IDM_COURSE_WFP_WorkflowService Email  4
  4. A custom Task Results page appears.  
  5. Go to your notifications folder and you will have an email. (see the image below)
    • For the course purpouse we are  using th c:\idm\notifications\notifications.txt




  1. If you open the  body content as a HTML content you will see the content like the image below.





(4.5)Email Enabling HTML & CSS


  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow used to send an email template, basic functionality
Workflow IDM_COURSE_WFP_WorkflowService Email 5   Download
Email Template
IDM_COURSE_EMT_WorkflowService Email 5    Download
Comments
Bold Code
Email Template.

On the Email Template tag we are enabling the HTML content for the notification body changing the htmlEnabled='false'   to  htmlEnabled='true'

The body tag is used to  define the content of the email to be sent by IDM.

Inside the body we are inserting CSS &  HTML code to be  displayed in the notification.


CODE
Email Template

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE EmailTemplate PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" name="IDM_COURSE_EMT_WorkflowService Email 5"-->
<EmailTemplate name='IDM_COURSE_EMT_WorkflowService Email 5' lock='Configurator#1208296000468' creator='Configurator' createDate='1208293389093' lastModifier='Configurator' lastModDate='1208295700421' lastMod='2' smtpHost='localhost' fromAddress='idm.course@idm.com' toAddress='any.user@idm.com' htmlEnabled='true'>
    <Variable name='oneApps'>
        <get>
            <ref>appsOutIdm</ref>
            <s>1</s>
        </get>
    </Variable>
    <Variable name='appsOutIdm'>
        <remove>
            <ref>applications</ref>
            <s>Lighthouse</s>
        </remove>
    </Variable>
    <subject>IDM with Passion Course</subject>
    <body>&lt;&#33;&#68;OCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&#xA;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&#xA;&lt;head&gt;&#xA;&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;&#xA;&lt;title&gt;Untitled Document&lt;/title&gt;&#xA;&lt;style type="text/css"&gt; &#xA;body {&#xA;&#x9;background-color: #FFFFCC;&#xA;}&#xA;&#xA;body, td, th, h3, h6 {&#xA;&#x9;color: #330000;&#xA;}&#xA;&#xA;h1, h2, h4, h5 {&#xA;  color: #660000;&#xA;}&#xA;&#xA;a {&#xA;&#x9;color: #003366;&#xA;}&#xA;&lt;/style&gt;&#xA;&#xA;&lt;/head&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;body&gt;&#xA;&lt;h4 align="center"&gt;This is an example about how to use a basic email template with HTML &amp; CSS.&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;  &lt;li&gt;Showing information for the $(accountId) user.&lt;/li&gt;&#xA;  &lt;li&gt;All Applications assigned $(applications)&lt;/li&gt;&#xA;  &lt;li&gt;All Applications assigned removing IDM  application $(appsOutIdm)&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/body&gt;&#xA;&lt;/html&gt;&#xA;</body>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</EmailTemplate>


  1. Click the Server Tasks tab at the top of the page
  2. Click the Run Tasks subtab on the left
  3. Click the workflow to execute  IDM_COURSE_WFP_WorkflowService Email 5
  4. A custom Task Results  page appears.  
  5. Go to your notifications folder and you will have an email. (see the image below)
    • For the course purpouse we are  using th c:\idm\notifications\notifications.txt





  1. If you open the  body content as a HTML content you will see the content like the image below.




                                                                                                                    return to the top


Exercise 5: Audit Workflow  Service


  1. Audit  Workflow Service

(4.1)Email Workflow Service



  1. Download the code for the workflow and form or copy and paste the code from this exercise under you Netbeans Project.

Scenario Workflow using an activity that launch the Create View workflow services, this operation will allow you create an user in idm when you use the User View as a Parameter.

Also we use  the Notify workflow services, this operation will allow you send emails thru idm and  an Audit Event to create an audit record in IDM for the create operation.
Workflow IDM_COURSE_WFP_WorkflowService Audit 1   Download
Email Template
IDM_COURSE_EMT_WorkflowService Audit 1    Download
Comments
Bold Code
Workflow.

We use the Activity Audit Event  to execute an action to call the audit workflow service.  This workflow service allow you to generate a record in the audit table for idm and will give you the capability to get a report about the operation realized.


CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Fri May 09 00:03:48 CDT 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_WorkflowService Audit 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_WorkflowService Audit 1' lock='Configurator#1210386407312' creator='Configurator' createDate='1210309428453' lastModifier='Configurator' lastModDate='1210311291843' lastMod='5' taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>
    <Extension>
        <WFProcess name='IDM_COURSE_WFP_WorkflowService Audit 1' maxSteps='0'>
            <Variable name='accountId' value='999014'/>
            <Variable name='firstName' value='Brian'/>
            <Variable name='lastName' value='Johnson'/>
            <Variable name='password' value='pa55w0rd'/>
            <Variable name='email' value='brian.johnson@idm.com'/>
           
            <Activity id='0' name='end'>
                <WorkflowEditor x='383' y='10'/>
            </Activity>
           
            <Activity id='1' name='start'>
                <Transition to='Create User'/>
                <WorkflowEditor x='43' y='10'/>
            </Activity>
           
            <Activity id='2' name='Create User'>
                <Action id='0' name='Create a View for the User' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='createView'/>
                    <Argument name='type' value='User'/>
                    <Argument name='id' value='$(accountId)'/>
                    <Argument name='viewId' value='User'/>
                </Action>
                <Action id='1' name='Set the values for the View'>
                    <expression>
                        <block>
                            <set name='user.global.accountId'>
                                <ref>accountId</ref>
                            </set>
                            <set name='user.global.password'>
                                <ref>password</ref>
                            </set>
                            <set name='user.global.firstname'>
                                <ref>firstName</ref>
                            </set>
                            <set name='user.global.lastname'>
                                <ref>lastName</ref>
                            </set>
                            <set name='user.global.fullname'>
                                <concat>
                                    <ref>firstName</ref>
                                    <s> </s>
                                    <ref>lastName</ref>
                                </concat>
                            </set>
                            <set name='user.global.email'>
                                <ref>email</ref>
                            </set>
                        </block>
                    </expression>
                </Action>
                <Action id='2' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='provision'/>
                    <Argument name='user' value='$(newViewUser)'/>
                    <Argument name='noCreate' value='false'/>
                </Action>
                <Transition to='end'>
                    <eq>
                        <ref>WF_ACTION_ERROR</ref>
                        <s>true</s>
                    </eq>
                </Transition>
                <Transition to='Send Notification'/>
                <WorkflowEditor x='116' y='10'/>
            </Activity>
           
            <Activity id='3' name='Send Notification'>
                <Action id='0' application='com.waveset.provision.WorkflowServices'>
                    <Argument name='op' value='notify'/>
                    <Argument name='template' value='IDM_COURSE_EMT_WorkflowService Audit 1'/>
                    <Argument name='accountId'>
                        <ref>accountId</ref>
                    </Argument>
                </Action>
                <Transition to='Audit Event'/>
                <WorkflowEditor x='171' y='349'/>
            </Activity>
           
            <Activity id='4' name='Audit Event'>
                <Action id='0' application='com.waveset.session.WorkflowServices'>
                    <Argument name='op' value='audit'/>
                    <Argument name='type' value='User'/>
                    <Argument name='name' value='Account created was  $(accountId)'/>
                    <Argument name='status' value='success'/>
                    <Argument name='action' value='Create'/>
                    <Argument name='resource' value='Lighthouse account'/>
                    <Argument name='accountId' value='$(accountId)'/>
                    <Argument name='error' value='User Duplicated'/>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='246' y='193'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

 
  1.  Delete the user  999010 created in the previous exercise
  2. Select the Server Tasks
  3. Select Run Tasks
  4. Select the workflow to execute  IDM_COURSE_WFP_WorkflowService Audit 1
  5. A Task Result  page appears (see the image below)
     

  1.       Go to your notifications folder and you will have an email  with the 999010 was created as a msgBody. (see the image below)
      • For the course purpouse we are  using th c:\idm\notifications\notifications.txt

      


  1. Click the Report tab at the top of the page
  2. Select the  Today's Activity checkbox and click the Run button (see the image below).




  1. The Report Results page appears





                                                                                                                    return to the top