If you have worked with Configuration Elements and workflows, you know you can bind Configuration Element Attributes (CEAs) to workflows. This is useful when moving workflows across vRO environments because you set all of your localized variables in the Elements and when workflows sync across environments they just use the Element Attribute in the environment the workflow lands in. You can also UPDATE configuration element attributes programmatically allowing for variables that live external to workflow execution. (world variables)
At any rate...
After passing in vCACCafe:VCACHost, vCAC:VCACHost, and other objects into my Actions time and again... I decided I needed a similar mechanism within vRO Actions to bind variables found in Configuration Elements: so I wrote one. (I am sure I am not the first, but I haven't seen it shared in the communities)
There are two relatively significant capabilities enabled by this action:
1. Pull any configuration element attribute into any vRO Action.
2. Access the data in any vRO configuration element (including arrays of string) from ANY ASD workflow form field.
Please note that I didn't put any error checking in the action. It could be improved with try/catch/throws and possibly default returns.
Here is a quick demo...
Environment
This is the configuration element being worked with. I chose a simple string array because I cannot share some data in our lab, although the intent is that ANY variable object is possible. It means you can take less in as method execution inputs where applicable. Your Café and VCAC hosts would be good examples: as would any other plugin library object where the variable is static. (or semi-static.. because you can update the "configuration element attribute" out of band)
1. Pull any configuration element attribute into any vRO Action
a. Create an action and simply call the getAnyConfigElementAttributeValue(categoryName, elementName, attributeName) action to assign an externally sourced configuration element to a variable during execution.
b. Example workflow runtime of 1) my demoAction action 2) which calls the getAnyConfigElementAttributeValue action 3) which gets the configuration element object to deliver back to the demoAction. The workflow just provides the input and then Syslogs the output.
2. Access the data in any vRO configuration element attribute (including arrays of string) from ANY ASD workflow form field.
In vRA 6.2 ASD you can call "External" vRO Actions to give you data on form load for Custom Resources, Service Blueprints, and Resource Actions. With the attached action, you can pull Configuration Element Attribute strings and array of strings into form fields by specifying the configuration element attribute target UP in the form field.
a. Added aString CEA.
b. Selecting the same workflow as before...
c. Set the default value of the string to that found in the CEA.
d. The form presentation pulls the CEA data into the field.
Enjoy! Improve it if you are able, and continue to share when you can. There are certainly some capabilities that can be built directly into the product that would make such an action unnecessary, but for now... at least for supplying VCAC Host and Café Host to my actions, I will be using this action against a CEA... and I welcome you to do the same.
Regards,
Sean Kohler