5.5.1

Table Of Contents
If the user has the right to run the workflow, hasRights returns true. Otherwise, hasRights returns
false.
2 Set the workflow attributes in a WorkflowTokenAttribute object.
The Web services client passes WorkflowTokenAttributes arrays to a WorkflowToken object, which runs
the workflow.
WorkflowTokenAttribute[] attributes = new WorkflowTokenAttribute[1];
WorkflowTokenAttribute attribute = new WorkflowTokenAttribute();
attribute.setName("vm");
attribute.setType(finderResult.getType());
attribute.setValue(finderResult.getDunesUri());
attributes[0] = attribute;
The preceding example creates a WorkflowTokenAttribute object, then populates it with the following
information:
n
The name of the attribute, in this case, vm.
n
The type of attribute, as discovered in a FinderResult object defined elsewhere in the code.
n
The attribute value, which in this case is a dunesUri string, signifying that the value specifies an
object accessed through a plug-in.
3 Run the workflow by calling the executeWorkflow operation.
To run a workflow, you pass the workflow attributes to the executeWorkflow operation in the form of a
WorkflowTokenAttribute array.
Running a workflow creates a WorkflowToken object, which represents the instance of the workflow that
runs with the specific input parameters that it receives when it starts.
WorkflowToken token = vsoWebControl.executeWorkflow(workflowId, username, password,
attributes);
In the preceding example, the attributes property is the array of WorkflowTokenAttribute objects
created in Step 2.
Sometimes, workflows require input parameters during their run. In these cases, you can provide
attributes through a user interaction while the workflow is running. You can pass attributes to the
workflow during its run using the answerWorkflowInput operation.
You implemented operations in the Web service client that check user permissions, pass attributes to a
workflow, and run the workflow.
What to do next
Implement operations in the Web services client to interact with workflows while they run.
Interact with a Workflow While it Runs
After the workflow starts, the Web services client can perform various actions in response to events while
the workflow is running.
Prerequisites
You must have implemented operations in the Web service client to run workflows in the Orchestrator
server.
Developing a Web Services Client for VMware vCenter Orchestrator
64 VMware, Inc.