VMware Cloud Community
lhoreis
Contributor
Contributor
Jump to solution

Edit input of type Properties using "User interaction" in workflow

Hello,

for my workflow I am using an input parameter of type Properties. The key/value pairs are coming from another workflow. In case of

an error I want to use an user interaction in my workflow which should enable the user to review the input and make changes

to the input by changing one or more values in order to let the workflow continue.

Let say I have something like this:

itemProperty = new Properties();

itemProperty.put("os","windows");

itemProperty.put("backup","yes");

[...]

itemProperty.put("application","mssql");

During the execution of the workflow it might happen, that an error occurs which for example could be fixed by changing

one or more of the given values, for example by setting "backup" to "no".

What is the best and safest way to achieve this in means of preserving the relationship between keys and values? I

Any input is highly appreciated!

Thanks in advance,

Lars

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Lars,

Unfortunately, vRO does not provide an editor component for objects of type Properties. One option to workaround this limitation is to try with an object of type Array/CompositeType(key:string,value:string).

So, in your workflow you need to define a new attribute, then click on type column, click on the link 'Define composite type', add 2 fields - key and value - of type string, and then select radion button 'Array Of'. Once you have an attribute of this type, you can add it as an external input for your user interaction element. Also, you'll need to add some scriptable task elements to write some code that will transfer the content between the attribute of type Properties and the attribute of type Array/CompositeType(...)

View solution in original post

2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Lars,

Unfortunately, vRO does not provide an editor component for objects of type Properties. One option to workaround this limitation is to try with an object of type Array/CompositeType(key:string,value:string).

So, in your workflow you need to define a new attribute, then click on type column, click on the link 'Define composite type', add 2 fields - key and value - of type string, and then select radion button 'Array Of'. Once you have an attribute of this type, you can add it as an external input for your user interaction element. Also, you'll need to add some scriptable task elements to write some code that will transfer the content between the attribute of type Properties and the attribute of type Array/CompositeType(...)

lhoreis
Contributor
Contributor
Jump to solution

Hello Ilian,

thank you for your quick response. I already feared, that there will be no painless solution. So I'll  follow your proposal and check whether it will work for me.

Regards,

Lars

Reply
0 Kudos