IDM Workflows - Forms - Views

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


Gabriel Magariño




Expected duration: 45 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: Create a Project in Netbeans


                The goal of this exercise is to let you experience about how to create a new project  using Netbeans as your IDE.


  1. Create  Identity Manager Project (Remote)
  2. Create  Workflow
  3. Upload Workflow  in Repository
  4. Run Workflow
  5. Code Review 

(0.1) Create Identity Manager Project ( Remote )



In this step,you are going to create a new Sun IdM Project using the plug-in for netbeans. This project is a  Remote project, this will let you download and upload xml object into the IDM Repository.

  1.  Initialize your Netbeans 5.5.1  program.
  2. Click on the File - New Project option from the menu (see the image below). 



  1. The New Project windows appears(see  image below )
  2. Select  under the Categories  the option Web
  3. Select under Projects  the Identity Manager Project (Remote)
  4. Click on the Next button





  1. The Name and Location window appears (see the image below)
  2. Under the Project Name write down Lab-007
  3. Under the project Location write down the paht  C:\IDM\Projects
      • C:\IDM\Projects
  1. Click the next button.






  1. The IDE Compatibility Bundle window appears (see image below).
  2. Under the location write down the path that is pointing to your ide-bundle.zip file  C:\IDM\Bundles\7.1\ide- bundle.zip
  1. Click Next button





  1. The Identity Manager Server Settings page appears
  2. Fill with the information that is showed in the image below
  3. Click the Finish Button




  1. IDM will take a few  seconds trying to connect  to your idm repository and configuring your netbeans to allow you to upload and download objects.




  1.  If  Netbeans completed sucessfully the conection you should receive  a screen  like the image below.





(0.2) Create Workflow


In this step, you are going create a workflow using the Identity Manager plug in for Netbeans.

  1. Click the option File - New File on the Menuw.

      


  1. Select Sun Identity Manager Objects as a Categories and Select Workflow as File Type
  2. Click the Next Button

      

  1. The Name and Location window appear (see image below)
  2. Write down the IDM_COURSE_WFP_Running workflow  as your File name
  3. Click the Finish Button

      

    1. Once that netbeans completed the workflow creation, you should be able to see the results like the image below.
      



(0.3) Upload Workflow in Repository


In this step, you are going Upload the workflow created before into  IDM repository

  1. Click on the IdM Menu
  2. Select the Upload Object  option (see image below)

      


  1. A windows to confirm your the object that you want to Upload appears.
  2. Click  OK button

      

    1. If IDM completed sucessfully the Upload process you should be able to see the result like the image below
      

  1. Some time would you prefer to work 100 % on a code view, for that you just need click under the Source button in your workflow view.
      


(0.4) Run Workflow


In this step, you are going to login into The Identity Manager Admin interface and  learn how to execute a workflow.

    1. Open a Web browser and type the following address into the address bar:
    1. Enter the User ID and Password
      

    1. Click the Server Task tab and select the Run Report Page

      

    1. Select the Run Tasks option

      

  1. Scroll down the page and select the IDM_COURSE_WFP_Running Workflow
  2. Click  the  under your workflow name link . See the image below.

      


  1. Once you selected your Workflow, this is launched automatically for IDM and Executed
  2. Every time that you execute a workflw you will see a Diagram  showing the workflow Status(see image below).

      




(0.5) Code Review





Scenario Create a new Workflow from scratch and execute it
Workflow IDM_COURSE_WFP_Running Workflow   Download
Form none
Subprocess
none
Rule none
Comments
Bold Code

In this  code you can see the name of the workflow and the two main activities for a Workflow (start / end).

CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<TaskDefinition name='IDM_COURSE_WFP_Running Workflow' 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_Running Workflow' maxSteps='0'>
            <Activity id='0' name='start'>
                <Transition to='end'/>
                <WorkflowEditor x='22' y='22'/>
            </Activity>
            <Activity id='1' name='end'>
                <WorkflowEditor x='201' y='37'/>
            </Activity>

        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>
Form
None
Subprocess
None
Rule
None


                                                                                                                    return to the top



Exercise 1: Workflow Using Manual Form


                The goal of this exercise is to let you experience how a workflow calls a a form that could allow an user introduce data.


  1. Code Review
  2. Execute Workflow

(1.1) Code Review



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

Scenario Workflow using an activity and with one action that call a Manual Form displaying data. The data were  harcoded just for course purpouse.
Workflow IDM_COURSE_WFP_Manual Form  Download
Form IDM_COURSE_FRM_Manual Form   Download
Subprocess
none
Rule none
Comments
Bold Code
Workkflow.
Shows the activity used to call  a Form during  this step named Call Form, all the form are called using a Manual Action, the parameter timeout -10 indicates that timeout of this form in seconds.


Form.
Shows the name of the form that is used for the workflow as a parameter, and the Display class indicate the kind of field that we are using to display information. For this example we are only using the Label class, but you can user another like text,text area,checkbox button,etc.





CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Wed Feb 13 19:57:47 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Manual Form" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Manual Form' creator='Configurator' createDate='1202954267093' lastModifier='Configurator' lastModDate='1202956477250' lastMod='2' 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_Manual Form' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='59' y='84'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' timeout='-10'>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Manual Form'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='276' y='96'/>
            </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>

Form
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" extensionClass="Form" lastMod="4" lastModifier="Configurator" name="IDM_COURSE_FRM_Manual Form"-->
<Configuration name='IDM_COURSE_FRM_Manual Form' creator='Configurator' createDate='1202954470671' lastModifier='Configurator' lastModDate='1202956473359' lastMod='4' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Call Form 1' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Manual+Form&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Manual Form'/>
                <Property name='subTitle' value='This form is displayed using a Manual Action in the workflow  with hardcode values in the Form.'/>
            </Display>
            <Field>
                <Display class='SectionHead'>
                    <Property name='title' value='User Information'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value' value='999010'/>
                    <Property name='title' value='AccountId'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value' value='Angus'/>
                    <Property name='title' value='Firstname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value' value='Young'/>
                    <Property name='title' value='Lastname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value' value='angus.young@idm.com'/>
                    <Property name='title' value='Email'/>
                </Display>
            </Field>
        </Form>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</Configuration>

Subprocess
None
Rule
None



(1.2) Execute Workflow


  1. Click on the Server Task navigation menu and  select the Run Tasks Option.
  2. Click on your Workflow IDM_COURSE_WFP_Manual Form 
  3. You will see a result page like the image below





                                                                                                                    return to the top



Exercise 2: Workflow Using Application


                The goal of this exercise is to let you experience about how to call a Workflow Services that will allow you to provision, deprovision or some other task in IDM


  1. Code Review
  2. Execute Workflow

(2.1) Code Review


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

Scenario Workflow using an activity and with one action that call an Application  (workflow service ) that  execute a disable operation for  the Administrator account
Workflow IDM_COURSE_WFP_Application   Download
Form none
Subprocess
none
Rule none
Comments
Bold Code
Workkflow.
Shows the activity used to call  a workflow service, the argument op indicate the operation type we are calling , the account Id the account we are disabling and the doWaveset parameter indicates that we want to disable the Idm account.

The idm account is the lighthouse account.




CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Thu Feb 14 23:56:51 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Application" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Application' creator='Configurator' createDate='1203055011734' lastModifier='Configurator' lastModDate='1203056074968' lastMod='3' 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_Application' 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='administrator'/>
                    <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>


Form
None
Subprocess
None
Rule
None



(2.2) Execute Workflow



  1. Click on the Server Task navigation menu and  select the Run Tasks Option.
  2. Click on your Workflow IDM_COURSE_WFP_Application
  3. You will see a result page like the image below







  1. After the execution of the workflow, the Administrator account  should appears disable.
  2. Click on the Accounts Tab and select List Accounts.
  3. The account administratior should appears with a red symbol (see image below).

          



  1. Before continue we are going to enable the Administrator using the Admin Interface

  1. Click on the Accounts Tab and select List Accounts.
  2. Check the checkbox for the  Administrator account and Select the Enable action under the User Actions dropdown button(see image below).

      



  1. A page appears showing a informatio for tha account to be enabled.
  2. Click OK button to proceed.

      


  1. If you pressed OK,  a page appears  with  the result of the enable operation.
  2. Click OK button

      

  1. If you go to the Account navigation  the account administratior should appears enabled (see image below).


      


                                                                                                                    return to the top




Exercise 3: Workflow using Script


     
  1.  Using Script in workflows

(0.1)Using Script in workflows



  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 and with one action that call a Manual Form, the form is populated using Script in the workflow.
Workflow IDM_COURSE_WFP_Script   Download
Form IDM_COURSE_FRM_Script    Download
Subprocess
none
Rule none
Comments
Bold Code
Workflow.

We are creating 3 variables - firstname,lastname and email -  and setting their values using xpress. We are using three differents actions for each variable.


<expression>   Used to define a script under the action.
<set>               Xpress function used to set a variable value
<concat>          Xpress function used to join two strings values
<s>                  Xpress function used to declare a String value

Form.
 
<ref>                Xpress function used to access a variable content defined 
                         previously in   the workflow



CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Wed Feb 13 21:17:00 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Script" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Script' createDate='1202959020937' lastModifier='Configurator' lastModDate='1205202602234' lastMod='16' 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_Script' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Script'/>
                <WorkflowEditor x='18' y='47'/>
            </Activity>
           
            <Activity id='1' name='end'>
                <WorkflowEditor x='368' y='28'/>
            </Activity>
           
            <Activity id='2' name='Script'>
                <Action id='0' name='Assigning  Firstname'>
                    <expression>
                        <set name='firstName'>
                            <s>Angus</s>
                        </set>
                    </expression>
                </Action>
                <Action id='1' name='Assigning Lastname'>
                    <expression>
                        <set name='lastName'>
                            <s>Young</s>
                        </set>
                    </expression>
                </Action>
                <Action id='2' name='Assigning Email'>
                    <expression>
                        <set name='email'>
                            <concat>
                                <concat>
                                    <concat>
                                        <ref>firstName</ref>
                                        <s>.</s>
                                    </concat>
                                    <ref>lastName</ref>
                                </concat>
                                <s>@idm.com</s>
                            </concat>
                        </set>
                    </expression>
                </Action>
                <ManualAction id='3' timeout='-10' syncExec='true'>
                    <WorkItemRequest>
                        <s> IDM Admin Interface  </s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <s>IDM System</s>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow Script</s>
                    </WorkItemDescription>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Script'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='153' y='146'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

Form
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" extensionClass="Form" lastMod="19" lastModifier="Configurator" name="IDM_COURSE_FRM_Script"-->
<Configuration name='IDM_COURSE_FRM_Script' creator='Configurator' createDate='1202959664218' lastModifier='Configurator' lastModDate='1205202096250' lastMod='19' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Script' baseContext='variables' noDefaultButtons='true' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Script&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Using Script'/>
                <Property name='subTitle' value='This form is displayed using a Manual Action in the workflow   and assigning their values with a Script'/>
            </Display>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>firstName</ref>
                    </Property>
                    <Property name='title' value='Firstname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>lastName</ref>
                    </Property>
                    <Property name='title' value='Lastname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>email</ref>
                    </Property>
                    <Property name='title' value='Email'/>
                </Display>
            </Field>
            <Field name='submitCancelButtons'>
                <Field name=':complete'>
                    <Expansion>
                        <s>true</s>
                    </Expansion>
                </Field>
                <Field name=':formButton' button='true'>
                    <Display class='Button'>
                        <Property name='label' value='Submit'/>
                        <Property name='value' value='Next'/>
                        <Property name='command' value='Save'/>
                    </Display>
                </Field>
                <Field name=':formButton' button='true'>
                    <Display class='Button'>
                        <Property name='label' value='Cancel'/>
                        <Property name='value' value='Cancel'/>
                        <Property name='command' value='SaveNoValidate'/>
                    </Display>
                    <Derivation>
                        <null/>
                    </Derivation>
                </Field>
                <Field name='formButton'>
                    <Expansion>
                        <ref>:formButton</ref>
                    </Expansion>
                </Field>
            </Field>
        </Form>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</Configuration>

Subprocess

Rule
None

  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. Select Server Tasks
  2. Select Run Tasks
  3. Select the workflwo to execute IDM_COURSE_WFP_Script
  4. A Custom Form Page appears (see the image below)
  5. Select the submit button to complete the exercise



         


    1. A Task Results Page appears (see the image below)
    2. Select OK button.

         



                             
                                                                                                                    return to the top



Exercise 4: Workflow using Subprocess


            
  1. Calling Subprocess

(0.1)Calling Subprocess


  1. Create a new IDM remote project under the folder  C:\IDM\Projects\Lab-009
  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 and with one action that call an Application  (workflow service ) that  execute a disable operation for  the Administrator account
Workflow IDM_COURSE_WFP_Subprocess   Download
Form IDM_COURSE_FRM_Subprocess    Download
Subprocess
IDM_COURSE_WFS_Subprocess   Download
Rule none
Comments
Bold Code
Subprocess.

We are using the Activity id=2 to call a subprocess.

The action id=0 is the action used to launch the subprocess.

process='Configuration:subprocess name'  is  the syntax used to specify the  subprocess to be called.

Note that a subprocess is under the configuration object type.




CODE
Workflow
Download File 
Form
Download File 
Subprocess
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Wed Feb 13 22:20:56 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Subprocess" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Subprocess' createDate='1202962856281' lastModifier='Configurator' lastModDate='1205202755609' lastMod='6' 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_Subprocess' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Call Subprocess'/>
                <WorkflowEditor x='18' y='47'/>
            </Activity>
           
            <Activity id='1' name='end'>
                <WorkflowEditor x='368' y='28'/>
            </Activity>
           
            <Activity id='2' name='Call Subprocess'>
                <Action id='0' process='Configuration:IDM_COURSE_WFS_Subprocess'>
                </Action>
                <Transition to='end'/>
                <WorkflowEditor x='151' y='145'/>
            </Activity>

        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

Rule
None

  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. Select Server Tasks
  2. Select Run Tasks
  3. Select the workflwo to execute IDM_COURSE_WFP_Subprocess
  4. A Custom Form Page appears (see the image below)
  5. Select the submit button to complete the exercise


         

    1. A Task Results Page appears (see the image below)
    2. Select OK button.

         


                                                                                                                    return to the top



Exercise 5: Get Objects from the Debug Interface


     The goal of this exercise is to let you experience about how to  get objects using the Debug interface. This will be necesary when you need to validate some change or execute minor changes in the xml object.
  1. Using Get  Object to review workflows
  2. Using Checkout Object  to review subprocess


(0.1)Using Get Objects to review workflows


  1. Login in  idm debug interface
  2. Under the Get Object button select the Type TaskDefinition
  3. Under the Name or ID  write down the  IDM_COURSE_WFP_Running Workflow
  4. Click Get Object button (see the image below)

         

  1. The Get Object results form appears.
  2. Based in your selection idm get the object and display it under your screen.

         



(0.2)Using Checkout Objects to review subprocess


  1. Login in  idm debug interface
  2. Under the Checkout Object button select the Type Configuration
  3. Under the Name or ID  write down the  IDM_COURSE_WFP_Subprocess
  4. Click Checkout Object button (see the image below)



         


  1. The Checkout Object results form appears.
  2. Based in your selection idm get the object and display it under your screen.


         

    
                                                                                                                    return to the top