Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

vRO workflow token can't get it's complex type attributes by invoking method WorkflowToken.getAttributes()

$
0
0

I have a workflow with a complex type attribute, default value was null for the attribute,  I want to run a script task to print current workflow token's attribute values by invoking method WorkflowToken.getAttributes(). Don't say to bind attribute with input/output parameter of script task than use the attribute directly, My objective is to create a generic action to do that thing. My script is:

var token = workflow;
System.debug(token);
if(token == null)
{    throw "No workflow token found";
}


System.debug("startDate: " + token.startDate);


var attributes = token.getAttributes();
if(attributes == null || attributes.keys.length == 0)
{
    throw "No attribute found for current workflow.";
}
System.debug("found " + attributes.keys.length + " attributes from current workflow.");


var keys = attributes.keys;
for (var i in keys) {
    var curKey = keys[i];    var curValue = attributes.get(curKey);   System.debug("attribute key: " + curKey + " attribute value: " + curValue);
}    System.debug("attribute key: " + curKey + " attribute value: " + curValue);
}

 

When I don't set value for the complex type attribute.

ComplexTypeNoValue.png

I could retrieve the attributes and get and null value of the complex type attribute.

Log.png

But once I set value of the complex attribute.

ComplexTypeWithValue.png

I got error when running the script task.

ErrorLog.png

I have tried many kinds of complex type, still get same error,I suspect if there's defect on vRO to retrieve complex type attributes from workflow token, or is there anything I missed? Can someone help me?


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>