###vcorestapipoc Second version is based on the vCO REST API and put together as part of whatever demo is taking place mid July 2013 The full REST API is not supported but the basics of searching for a workflow, triggering an execution with input parameters then monitoring(polling) for status and rest is there run run.sh without any options for help
####chaining Additional change was to support a chaining method. The idea here is that it provides an easy way to provide distinct steps in dealing with a workflow. From example used in demo.
./run.sh -p '/api/workflows?conditions=name=simple-demo' -m 'CHAIN' -o './vcoConfig.groovy' -c '/sampleflowchain/step1_WorkFlowLookupResponse. groovy:./sampleflowchain/step2_WorkFlowStartExecution.groovy:./sampleflowchain/step3_WorkFlowMonitorExecutionStatus.groovy'The run.sh is a wrapper script that passes options to vcoSimpleController with options:
- -m, The operation method, GET, POST, or CHAIN
- -o, The configuration file with information specific to the target vco instance
- -c, This is the specific option to be combined when using a CHAIN operation
The chaining concept is simple.
- The first script in the chain receives the results of the initial REST request injecting through the binding (this is Groovy Script specific in context so an understanding of Groovy is required)
- It does whatever is specific to that stage in the workflow then outjects whatever is ever necessary via the binding for the next script in the chain.
def outNodes = inBinding.jsonResponseData.links.attributes.flatten().findAll { it.name in ["itemHref","name"] }
// Required outBinding in chain
outBinding = outNodes.inject([:]) { map, node ->
// Addition will merge so add new maps with the name being the node, fix later
map << [(node.name): node]
map
}
- The next script in the chain has the outjected values from the previous step made available on its binding.
assert inBinding.itemHref