IDM Workflows - Variables

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


Gabriel Magariño


Expected duration: 40 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: Workflow Using Built-in Variables


                The goal of this exercise is to let you experience about how the Workflow built-in variables could be used in your custom workflow.


  1. Create Workflow with WF_CASE_OWNER built in variable
  2. Create Workflow with WF_ACTION_TIMEOUT  built in variable

(0.1) Create Workflow with WF_CASE_OWNER built in variable


  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 a Manual Form displaying data. The data were  harcoded just for course purpouse.

We are going to use the WF_CASE_OWNER built-in variable to configure the form for an user who is launching the workflow
Workflow IDM_COURSE_WFP_Built-in Variables 1   Download
Form IDM_COURSE_FRM_Built-in Variables 1    Download
Subprocess
none
Rule none
Comments
Bold Code
Workflow.

Activity id= 1. Shows the activity used to call  a Form (Call Form ).

ManualAction id=0. Shows the time out for this form before expire and the itemType approval


WorkitemRequester. Is doing some reference to the value of the variable WF_CASE_OWNER. The content for this variable is the user that launch a workflow.In our example if you are logging with the configurator user, configurator is the value for this variable

Owner.  Here you specify after launch the workflow, what is the user queue that should be assigned the request.We are using hardcoded pointing to the 999011 user queue.


CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Fri Feb 15 00:12:42 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Built-in Variables 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Built-in Variables 1' lock='Configurator#1203782642265' creator='Configurator' createDate='1203055962875' lastModifier='Configurator' lastModDate='1203782342218' lastMod='10' 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_Built-in Variables 1' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='103' y='202'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' timeout='2' itemType='approval'>
                    <WorkItemRequest>
                        <s>IDM Admin Interface</s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <ref>WF_CASE_OWNER</ref>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow with owner assigned with  built-in variable WF_CASE_OWNER</s>
                    </WorkItemDescription>
                    <Owner>
                        <s>999011</s>
                    </Owner>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Built-in Variables 1'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='197' y='173'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='327' y='184'/>
            </Activity>
           
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

Form
None
Subprocess
None
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. Create a new user 999011 or use the bulk action file to create it.   Download Bulk Action File

Attribute

Value

Identity

 

Account ID

99911

First Name

Angus

Last Name

Young

Email Address

angus.young@idm.com

Organization

Top

Manager is

Configurator

Password

P@ssword

Assigments

 

 

 

Security      

 

 

 

Delegations

 

 

 

Attributes

 

 

 

Compliance

 

 

 



    1. Select Server Tasks
    2. Select Run Tasks
    3. Select the workflow to execute IDM_COURSE_WFP_Built-in Variables 1  




  1. At this time your request was launched
  2. Select WorkItems
  3. Select My Work Items
  4. At this time  as you can see there is no request in your queue(see image below)
  1. Select Approvals queue





  1. You were pointed to the Approvals menu tab(see image below).
  2. As you can see there is no request for the user configurator.




  1. On the List Approvals for dropdown list select the user 999011 (see image below).

  1. Click under the request link



  1. The custom approval form appears (see the image below)
  2. Click Submit button and tha request shoul be terminated.



  1. Now we are going to modify our code to assign the Configurator user as the owner of the request.
  2. In Netbeans Select the  IDM_COURSE_WFP_Built-in Variables 1
  3. Click on the Source  Button (see image below)


  1. Modify the Owner from 999011 to a reference to the variable WF_CASE_OWNER (see code below).
CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Fri Feb 15 00:12:42 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Built-in Variables 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Built-in Variables 1' lock='Configurator#1203782642265' creator='Configurator' createDate='1203055962875' lastModifier='Configurator' lastModDate='1203782342218' lastMod='10' 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_Built-in Variables 1' maxSteps='0'>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='103' y='202'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' timeout='2' itemType='approval'>
                    <WorkItemRequest>
                        <s>IDM Admin Interface</s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <ref>WF_CASE_OWNER</ref>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow with owner assigned with  built-in variable WF_CASE_OWNER</s>
                    </WorkItemDescription>
                    <Owner>
                          <ref>WF_CASE_OWNER</ref>
                    </Owner>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Built-in Variables 1'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='197' y='173'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='327' y='184'/>
            </Activity>
           
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

Form
None
Subprocess

Rule
None

    1. Upload the code into IDM Repository (see image below).



  1. Now we are going to proceed with the execution
  2. Select Server Tasks
  3. Select Run Tasks
  4. Select the workflow to execute IDM_COURSE_WFP_Built-in Variables 1
  5. A task Result page appears
  6. Select Work Items
  7. Select My Work Items
  8. As this time the request previously launched appears under the Configurator Approvals (see image below)
  9. Select the Approvals menu tab






  1. At this time the request appears under the Configurator dropdown list (see image below).
  1. Select the request




  1. Our custom approval form appears (see image below).
  2. Click on the submit button to complete the request process.





  1. At this time your request is completed (see image below).





(0.2) Create Workflow with WF_ACTION_TIMEOUT built in variable



  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.

The workflow launch a request approval for the user administrator, if the administrator doesn't approve after one minute, the request is automatically escalated to the configurator user.

The escalation process occurrs due the timeout variable reach the time specify to continue the workflow process.
Workflow IDM_COURSE_WFP_Built-in Variables 2                     Download
Form IDM_COURSE_FRM_Built-in Variables 2                      Download
IDM_COURSE_FRM_Escalation Built-in Variables 2    Download
IDM_COURSE_FRM_Approved Built-in Variables 2     Download
IDM_COURSE_FRM_Rejected Built-in Variables 2      Download
Subprocess
none
Rule none
Comments
Bold Code
Workflow.

The next  code is used to call the manual form;the timeout=1  specify the minutes for the form to wait before timeout expiration.

<ManualAction id='0' name='approve' timeout='1' syncExec='true' itemType='approval'>

  • A positive number indicate minutes    1,2,3...n
  • A negative number indicate seconds   -1,-2,3...n

The next code is used for the form to validate if the variable WF_ACTION_TIMEOUT  reach the 1 minute specify  for the timeout=1.

The initial value for WF_ACTION_TIMEOUT is false  and change to true once that the timeout is reached.

<Transition to='Escalation'>
                    <eq>
                        <ref>WF_ACTION_TIMEOUT</ref>
                        <s>true</s>
                    </eq>
  </Transition>






CODE
Workflow
Download File
Form
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Fri Feb 15 00:42:42 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Built-in Variables 2" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Built-in Variables 2' lock='Configurator#1206252448562' creator='Configurator' createDate='1203057762765' lastModifier='Configurator' lastModDate='1206252148500' lastMod='27' 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_Built-in Variables 2' maxSteps='0'>
            <Variable name='approver' value='administrator'/>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='44' y='11'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' name='approve' timeout='1' syncExec='true' itemType='approval'>
                    <ReportTitle>
                        <concat>
                            <s>Awaiting approval from \n</s>
                            <ref>approver</ref>
                        </concat>
                    </ReportTitle>
                    <WorkItemRequest>
                        <s>IDM Course</s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <s>IDM</s>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow with owner assigned with  built-in variable WF_CASE_OWNER and  using WF_ACTION_TIMEOUT</s>
                    </WorkItemDescription>
                    <Owner name='$(approver)'/>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Built-in Variables 2'/>
                    </FormRef>
                    <Variable name='APPROVAL' value='false'/>
                    <Return from='APPROVAL' to='APPROVED'/>
                </ManualAction>
                <Transition to='Approved'>
                    <eq>
                        <ref>APPROVED</ref>
                        <s>true</s>
                    </eq>
                </Transition>
                <Transition to='Escalation'>
                    <eq>
                        <ref>WF_ACTION_TIMEOUT</ref>
                        <s>true</s>
                    </eq>
                </Transition>
                <Transition to='Rejected'/>
                <WorkflowEditor x='111' y='14'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='255' y='10'/>
            </Activity>
           
            <Activity id='3' name='Escalation'>
                <ManualAction id='0' syncExec='true' itemType='approval'>
                    <Owner>
                        <ref>configurator</ref>
                    </Owner>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Escalation Built-in Variables 2'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='186' y='12'/>
            </Activity>
           
            <Activity id='4' name='Approved'>
                <ManualAction id='0' syncExec='true'>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Approved Built-in Variables 2'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='152' y='103'/>
            </Activity>
           
            <Activity id='5' name='Rejected'>
                <ManualAction id='0' syncExec='true'>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Rejected Built-in Variables 2'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='128' y='288'/>
            </Activity>
        </WFProcess>
    </Extension>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
</TaskDefinition>

Subprocess
None
Rule
None


  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute IDM_COURSE_WFP_Built-in Variables 2 
  4. A Task Results Page appears (see the image below)
    1. As you can see in the image the request is pending for approval and the owner is the administrator




  1. Select Workitems menu
  2. Select Approvals
  3. Select Configurator



  1. On the dropdown list select Administrator (see image below)




  1. A customized approval form appears. (see the image below)
  1. Wait for 1 minute to allow IDM automatically get the timeout and proceed with the escalation.



  1. After one minute the request is no longer under the Administrator approval, it was escalated to the Configurator. (see image below).
  2. Click under the Unknown Request




  1. A customized Escalation form appears(see the image below)
  2. Click Submit or cancel button to complete the exercise.





                                                                                                                    return to the top

Exercise 1: Workflow Using Variables


                The goal of this exercise is to let you experience about how the Workflow variables could be used in your custom workflow.


  1. Using variables.variable
  2. Using variables context
  3. Creating variable list in workflow
  4. Creating variable using def var in form
  5. Creating variable inside a field
  6. Accessing variable with <ref>   and $(variable)

(1.1) Using variables.variable



  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 displaying data.


The form is populated creating variables in the workflow and accesing to this values in a form through a variables.variable syntax.
Workflow IDM_COURSE_WFP_Variables 1     Download
Form IDM_COURSE_FRM_Variables 1      Download
Subprocess
none
Rule none
Comments
Bold Code
Workflow.

The next code is used to define a variable and their content in a workflow.

            <Variable name='firstName' value='Malcom'/>


Form.

The next code is used to access the variable content. Any variable comming from the workflow is accesed  using the syntax variables.variable  if we are not using the variable context base.


          <ref>variables.firstName</ref>


CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Sun Feb 17 12:18:45 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Variables 1" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Variables 1' lock='Configurator#1206253652750' creator='Configurator' createDate='1203272325906' lastModifier='Configurator' lastModDate='1206253352640' lastMod='7' 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_Variables 1' maxSteps='0'>
            <Variable name='firstName' value='Malcom'/>
            <Variable name='lastName' value='Young'/>
            <Variable name='email' value='malcom.young@idm.com'/>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='89' y='107'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' timeout='1'>
                    <WorkItemRequest>
                        <s>IDM Admin Interface</s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <s>IDM System</s>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow using variables</s>
                    </WorkItemDescription>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Variables 1'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='228' y='90'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='338' y='84'/>
            </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="12" lastModifier="Configurator" name="IDM_COURSE_FRM_Variables 1"-->
<Configuration name='IDM_COURSE_FRM_Variables 1' lock='Configurator#1206253655640' creator='Configurator' createDate='1203272420312' lastModifier='Configurator' lastModDate='1206253355578' lastMod='12' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Variables 1' noDefaultButtons='true' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Variables+1&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Using Variables'/>
                <Property name='subTitle' value='Declaring a String variable in workflow and using &lt;b&gt;variables.[  your variable  ] &lt;/b&gt; to access to their value'/>
            </Display>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>variables.firstName</ref>
                    </Property>
                    <Property name='title' value='Firstname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>variables.lastName</ref>
                    </Property>
                    <Property name='title' value='Lastname'/>
                </Display>
            </Field>
            <Field>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>variables.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
None
Rule
None

    1. Select the Server Tasks
    2. Select Run Tasks
    3. Select the workflow to execute  IDM_COURSE_WFP_Variables 1
    4. A Form  Page appears (see the image below)

       

    1.  Click the submit button  to complete the exercise. ( see the image below )

      


(1.2) Using variables context


    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 displaying data. The data were  harcoded just for course purpouse.


The form is populated creating variables in the workflow and using the variables context in the form.
Workflow IDM_COURSE_WFP_Variables 2    Download
Form IDM_COURSE_FRM_Variables 2     Download
Subprocess
none
Rule none
Comments
Bold Code
Form.

The next code in the form  define the base context for the form, with this we avoid to use the variables.variable syntax and now we can access to the variable content with just write down the name of this.

                baseContext='variables'


The next code access to the variable content using the base context

               <ref>firstName</ref>


CODE
Workflow
  Download File
Form
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" extensionClass="Form" lastMod="8" lastModifier="Configurator" name="IDM_COURSE_FRM_Variables 2"-->
<Configuration name='IDM_COURSE_FRM_Variables 2' lock='Configurator#1206254027609' creator='Configurator' createDate='1203274367812' lastModifier='Configurator' lastModDate='1206253727546' lastMod='8' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Variables 2' baseContext='variables' noDefaultButtons='true' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Variables+2&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Using Varibales'/>
                <Property name='subTitle' value='Declaring a String variable in workflow and using variable context in the form'/>
            </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
None
Rule
None



  1. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute  IDM_COURSE_WFP_Variables 2
  4. A Form  Page appears (see the image below)
  5. Click the Submit button to complete the exercise

      



(1.3) Creating variable list in workflow


    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 displaying data.

Creating a variable list in workflow
Workflow IDM_COURSE_WFP_Variables 3              Download
Form IDM_COURSE_FRM_Variables 3               Download
Subprocess
none
Rule none
Comments
Bold Code
Workflow.

The lstContinent variable was defined to contain a list elements.

<List> elements </List> is the XPRESS function used to declare a list.

<String> value <String> is the XPRESS function used to declare the elements for the list.


Form.

The next code is used for the label class to access to the list defined in the workflow.

             <ref>lstContinent</ref>


CODE
Workflow
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC 'waveset.dtd' 'waveset.dtd'>
<!--  MemberObjectGroups="#ID#Top" createDate="Sun Feb 17 13:07:23 CST 2008" extensionClass="WFProcess" name="IDM_COURSE_WFP_Variables 3" visibility="runschedule"-->
<TaskDefinition name='IDM_COURSE_WFP_Variables 3' creator='Configurator' createDate='1203275243750' lastModifier='Configurator' lastModDate='1206254467875' 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_Variables 3' maxSteps='0'>
            <Variable name='firstName' value='Malcom'/>
            <Variable name='lastName' value='Young'/>
            <Variable name='email' value='malcom.young@idm.com'/>
            <Variable name='lstContinent'>
                <List>
                    <String>America</String>
                    <String>Europe</String>
                    <String>Asia</String>
                    <String>Africa</String>
                    <String>Australia</String>
                </List>
            </Variable>
           
            <Activity id='0' name='start'>
                <Transition to='Call Form'/>
                <WorkflowEditor x='89' y='107'/>
            </Activity>
           
            <Activity id='1' name='Call Form'>
                <ManualAction id='0' timeout='1'>
                    <WorkItemRequest>
                        <s>IDM Admin Interface</s>
                    </WorkItemRequest>
                    <WorkItemRequester>
                        <s>IDM System </s>
                    </WorkItemRequester>
                    <WorkItemDescription>
                        <s>Workflow using variables</s>
                    </WorkItemDescription>
                    <FormRef>
                        <ObjectRef type='UserForm' name='IDM_COURSE_FRM_Variables 3'/>
                    </FormRef>
                </ManualAction>
                <Transition to='end'/>
                <WorkflowEditor x='229' y='84'/>
            </Activity>
           
            <Activity id='2' name='end'>
                <WorkflowEditor x='338' y='84'/>
            </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_Variables 3"-->
<Configuration name='IDM_COURSE_FRM_Variables 3' lock='Configurator#1206254540062' creator='Configurator' createDate='1203275260765' lastModifier='Configurator' lastModDate='1206254240000' lastMod='4' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Variables 3' baseContext='variables' noDefaultButtons='true' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Variables+3&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Using Varibales'/>
                <Property name='subTitle' value='Declaring a List  variable in workflow and using variable context in the form'/>
            </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>
                <Display class='Label'>
                    <Property name='value'>
                        <ref>lstContinent</ref>
                    </Property>
                    <Property name='title' value='Musician listened in  '/>
                </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. Select the Server Tasks
  2. Select Run Tasks
  3. Select the workflow to execute  IDM_COURSE_WFP_Variables 3
  4. A Form  Page appears (see the image below)
  5. Click the Submit button to complete the exercise

      

         

(1.4) Creating variable using defvar in form


    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 displaying data.

Creating a variable list in Form using expression / def var function
Workflow IDM_COURSE_WFP_Variables 4         Download
Form IDM_COURSE_FRM_Variables 4          Download
Subprocess
none
Rule none
Comments
Bold Code
Form.

<defvar>    Is used to define a variable lstContinent


<List> elements </List> is the XPRESS function used to declare a list.

<String> value <String> is the XPRESS function used to declare the elements for the list.


The next code is used for the label class to access to the list defined in the workflow.

             <ref>lstContinent</ref>


CODE
Workflow
Download File
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_Variables 4"-->
<Configuration name='IDM_COURSE_FRM_Variables 4' lock='Configurator#1206254999234' creator='Configurator' createDate='1203275837937' lastModifier='Configurator' lastModDate='1206254699171' lastMod='4' wstype='UserForm'>
    <Extension>
        <Form name='IDM_COURSE_FRM_Variables 4' noDefaultButtons='true' objectLocationID='objectType=UserForm&amp;objectName=IDM_COURSE_FRM_Variables+4&amp;objectPath=0&amp;isBegin=true'>
            <Display class='EditForm'>
                <Property name='title' value='Using Varibales'/>
                <Property name='subTitle' value='Declaring a List  variable in Form workflow and using  expression'/>
            </Display>
            <defvar name='lstContinent'>
                <List>
                    <String>America</String>
                    <String>Asia</String&