... Please click [here|Lookup Role User DSC] for full reference on Lookup Role User DSC.
Please click [here|Strategy to Perform Migration from Development Server to Production Server Involving LookupRoleUser DSC] to find out the strategy to perform migration from development to production environment for processes involving this DSC.
h2. How to assign tasks to users according to their roles as a step in a workflow
h3. Summary
Sometimes we want one of the partipants in a workflow to decide who would perform each of the tasks in that particular workflow. This is often difficult to do in LC Workflow, where it is usually the process designer who decides who performs each step.
Avoka have developed a component and a Workflow-enabled Flex form that make it very simple for one participant in a workflow to select who the other participants should be. \\
|
h3. Scenario
|
| When designing a workflow or a process that involves a user step, that is assigning a task to a user, it is often required for the process designer to know in advance who should the task be assigned to, whether it is Tom, or Jack, or a group. In most of the cases, the user might varied per process instance. Designing a process user step that assigns task to a user or group, loses the flexibility to achieve that. For each process instance, it will run with the exactly same pattern depending on how the process is designed, in this case the same user/group get assigned the task again and again. |
| When designing a workflow or a process that involves a user step, that is assigning a task to a user, it is often a requirement for the process designer to know in advance who the task should be assigned to, be it Tom, or Jack, or a group. In most cases, the user might vary per process instance. Designing a process user step, which assigns the task to a user or group, looses the flexibility to achieve that. For each process instance it will run with the exact same pattern depending on how the process is designed, and in this case the same user/group gets assigned the task again and again. |
| |
| To make it dynamically assign task to a user/group, we could use process variable that store the user/group identifier and then assigning a task to a user/group based on the process variable value. |
| To make it dynamically assign a task to a user/group, we could use the process variable that stores the user/group identifier and then assign the task to a user/group based on the process variable value. |
| |
| In a process that has multiple user steps of different levels, it is necessary to know who can be assigned to what tasks.
And this
This
requires a concept of assigning task to users according to their roles. For example, a Leave Application would include the applicant, with their manager and maybe their director being involved
in the process of approving or declining the leave request. Depending
upon who is the applicant, their manager
and/or their director might not be same person. |
| |
| To achieve that objective, we have provided
the
Avoka Lookup Role User DSC including a Flex Application, to allow a process designer the ability to assign
tasks
to
users
according to their role as determined on a per process instance basis. |
| |
| At the start of the process, it launches the Flex Application assigned to a person who has the authority to determine role for this process, and then it progresses to the steps in the process. When it comes to assigning task to a user, you need to insert a step before User step, that is calling Lookup Role User operation to find out which user holds a particular role in the current process instance, so that the User step can later use the user identifier returned for assigning task the user that holds the role. |
| At the start of the process, it launches the Flex Application which assigns it to a person who has the authority to determine the role for this process, and to progress it through the steps in the process. When it comes to assigning a task to a user, you need to insert a step before User step, that is calling Lookup Role User operation to find out which user holds a particular role in the current process instance, so that the User step can later use the user identifier returned, for assigning the task to the user that holds the role. |
| |
| For maintenance on what process to have what roles, Lookup Role User provides a custom editor for
a process
designer to add and delete role for a process, which will be discussed in more
details
below. |
h3. The Lookup Role User Service |
... This contains an operation, called "Lookup Role User", that looks up for user who has been assigned the specified role and return the user identifier and common name. !operation.jpg|align=left! \\ To obtain an evaluation copy of the Lookup Role User Service, go to the Avoka Website: [http://www.avoka.com] and follow the links. The Lookup Role User DSC, once installed, will appear as a new service under the category Avoka in your LiveCycle WorkBench.
!services.jpg|align=left!
h3.
\\ \\ \\
h3. The Flex Application to Assign Users to each Role
|
This has been developed by Avoka Technologies, to work in conjunction with Lookup Role User DSC, as an application to assign roles to users. The Flex application looks like this:
|
|
!flex.jpg! |
Based on the process ID that is injected into the Flex Application, it will pre-populate the form with all the roles for the process. The user can then make use of the search mechanism to find the matching user, and assign them a role or roles, by dragging and dropping the user to the role. |
... h3. The Process
|
!process.jpg!\\ \\ |
| As shown in the figure above, at the start of the process, it initializes the Flex Application by injecting the current process ID required for the Flex Application to operate. The second step is the Flex Application itself assigned to an authorized user to determine who holds the different roles for this current process
instance. And then at the
instance. The
step before the user
step, it has "Lookup
step, has the "Lookup
Role User"
step to
find out who holds a particular role,
and in
with the
user
step,
assigning a task to the user returned from
the "Lookup
Role User" step. Therefore, this achieves the assigning of tasks to users according to their roles as set on a per process instance basis. An UserRoleNotSetException will be thrown when invoking step "Lookup Role User" operation to lookup for a role, where no user has been assigned to that role. It is very likely that you will want to catch this exception and to have a route back to the Flex Application step to set role users again. |
| |
| |
For demonstration purpose, we have provided the exported [sample process|^sampleProcess.xml]and the [Flex Application|^RoleUserSetup.swf]to set up user roles for the process described above, as attachments to this article. You can import it as a process to your LiveCycle ES via workbench for guidance in setting up property values for the Lookup Role User operation step. You will also need to upload the Flex Application to your LiveCycle ES Server via Workbench in Form Design perspective, and update the process form variable template url location accordingly.
h3. Setting up Flex Application as One of the Step in the Process
|
| When you
After you
have downloaded the Flex Application from the link in
the
previous section, this is how to make
it as part
it part
of your process. |
\- Upload the Flex Application form to LiveCycle ES Server via Workbench on its "Form Design" perspective. Go to "Resources" view and you can drag and drop the Flex Application (.swf) file into that view to your desired folder. |
... |
\- Switch to "Process Design" perspective on your Workbench and make sure you are currently editing your process by right clicking on the process and select "Edit".
|
| \- Open up "Variable" view, if it hasn't
already
been opened. Create a process variable of type "Form", by clicking on the "Plus" button located on top of that view. For reference, you can import the sample process attached, and import into your server via Workbench to see how the form variable is setup
(Note: flexApp
is the Flex Application variable). |
!flexsetup.jpg|align=left!\\ |
... \\ \\ \- Click on the "Advance Settings ..." button on that dialog, and make sure your setting are as follows, first by clicking on the "Browse ..." button and select Foundation>Repository>Read Resource Content and click "OK", and then manipulate the properties for the service input and output parameters to be as shown in the snapshot below. |
!flexsettings.jpg! |
| \- Now the Flex Application has been set up as a process variable ready to be
assigned
to a user, alongside other properties like "Initial User Selection" that in this case, determines who gets to assign
a
user to each role, what is the task instruction, and so on. |
| |
|
|
!flexuser.jpg! |
... h3. Managing Roles in a Process Using Lookup Role User Operation Custom Editor
!manageRole.jpg!\\ \\ When creating a new process in Workbench, the roles for this process have not been created. To create roles for the process, you need to drop in "Lookup Role User" operation to the process, and click on "Properties".
One of the input properties is role, and by default its value is set literally using a custom editor defined for this input property as shown in the picture above. Select the process you want to manage the roles for, and there are "Add" and "Delete" button to add and delete role for the process respectively. The role combo box will be updated accordingly when a process is selected.
The selected role will be used in this operation at execution time to lookup for its role user.
|
h3. Setting Properties for Setting Initial Data to Flex Application using SetValue
|
| \\
!initialProperties.jpg!\\ |
\\ |
... To configure the properties of the SetValue operation step, click on that step, and then click on "Properties" view on your Workbench. It will show a dialog box as shown above. \\
/process_data/@id will give you the current process ID and it is injected into your Flex App variable, in this case the variable name is called "flexApp". \\
h3. Setting Properties for Lookup Role User Operation
!lookupProperties.jpg! |
To configure the properties of the Lookup Role User operation step, click on that step, and then click on "Properties" view on your Workbench. It will show a dialog box as shown above.
|
| Select your current process in the process combo box. It will load a list of roles for the process. Select which role you want to lookup for the role user for. For the output, it returns the principal ID and common name for the role
user,
if found. |
Alternatively, if you already know the role name that you want to lookup for, as stored in a process variable or form, you can specify the Role input property via "XPath" or "Variable". |
... h3. Setting Properties for Assign Task Operation after Lookup Role User Operation
!assignTaskProperties.jpg!
|
To configure the properties of the AssignTask operation step, click on that step, and then click on "Properties" view on your Workbench. It will show a dialog box as shown above. |
| Expand the section "Initial User Selection" and select the radio button "XPath expression" option for specifying
the
user to be assigned the task, and
then
select the user identifier returned from
the "Lookup
Role User" step; in this example it is stored in variable "assigned_user". You can also optionally include the user common name that gets returned by
the "Lookup
Role User" into the task instruction as shown above. |
| \\ |