This recipe will teach us how to create user interactions. User interactions are additional inputs that can be asked of users during the workflow execution.
We need to be able to create a new workflow.
For this recipe, you will need to have more than one AD/LDAP/SSO group configured to access Orchestrator. Remember that you can use the Orchestrator internal LDAP to test this. To facilitate this, please follow the recipe User management in Chapter 7, Interacting with Orchestrator.
For the example, in the There's more... section, we will also showcase the interaction with the vSphere Web Client.
We will split this recipe into two parts, the creation of the interaction workflow and the test run that will show how to answer the interaction.
Name |
Type |
Section |
Use |
|
LdapGroup |
IN |
This contains the group that is enabled to answer the interaction. |
|
String |
Attribute |
This is defined when the user answers the interaction. |
|
String |
Attribute |
This contains the error code. |
|
Date |
IN |
This is the date until the customer interactions waits for answers. |
|
String |
IN |
This is a string value that is defined when the workflow starts. |
group
attribute an LDAP group that should be allowed to answer the interaction (if you don't have an LDAP/AD/SSO, you can use vcousers
from the local Orchestrator LDAP).security.group
and timeout.date
attributes, as well as arrays for users and groups. The security.group
(or the arrays) attribute defines which users (or groups) are allowed to answer this user interaction. Bind this attribute to the group
attribute. The timeout.date
attribute defines when this user interaction expires. Bind the date
in-parameter to it.
userString
attribute:
inString
and userString
variables as an in-parameter to it. Also, bind the outString
out-parameter as an out-parameter. In the scripting section, add outString=inString+UserString
.
userString
and click on Submit.User interactions are created so that a workflow can get additional input when it is already running. You can define variables (External inputs) as an input that a user should use, and you can format the input as you have already learned in the recipe Workflow presentations in Chapter 5, Visual Programming.
The security.assignee
and security.assignee.groups
fields are new in vRO 7. Please note that you can assign the security group or array input as NULL
.
The important thing is that you can define a security group that is the recipient of this user request. This makes it possible that one group of Orchestrator users (for example, VM requesters) can start a workflow and have the workflow wait until a different group (VM approvers) has answered the user interaction.
The expiry date is also useful as it lets you define when a user action was not answered in a certain timeframe. If a user interaction was not answered, the User interaction element will generate an error with the Timeout on signal message. This makes it possible to create a follow-up action, for example, send an e-mail to the VM requester that his request has failed.
A workflow that is in the state of Waiting keeps this state, even if the Orchestrator server is powered off, as this information is stored in the Orchestrator database.
A common practice is to put the security group that is used into a configuration (see the recipe Working with configurations in Chapter 8, Better Workflows and Optimized Working).
To use the vSphere Web Client to answer a user interaction, follow these steps: