4.1

Table Of Contents
Procedure
u
Create a Workflow object by calling the getWorkflowForID operation.
String workflowId = "1880808080808080808080808080808087808080011713796199469943be4c882";
Workflow workflow = vsoWebControl.getWorkflowForID(workflowId, username, password);
You found a workflow in the Orchestrator server that the Web service client can run on objects.
What to do next
Implement operations in the Web services client to run the workflows it finds.
Run Workflows from a Web Service Client
The main purpose of a Web services client is to run workflows across a network.
Prerequisites
You must have implemented Web service operations in the client to find workflows in the Orchestrator server.
Procedure
1 (Optional) Check the workflow user permissions by calling the hasRights operation.
You can verify if a user has rights to read, run, or edit a particular workflow using the hasRights operation.
This operation is not mandatory, but checking user rights before you run a workflow can help prevent
exceptions.
String workflowId = "1880808080808080808080808080808087808080011713796199469943be4c882";
Boolean rights = vsoWebControl.hasRights(workflowId, username, password, 'x');
The preceding code example calls the hasRights operation to discover whether the user has the right to
run the workflow identified by workflowId.
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.
Chapter 8 Developing a Web Services Client
VMware, Inc. 253