VMware Cloud Community
fredoenglish
Contributor
Contributor
Jump to solution

String Invalid parameters

Hello,

I often have validation error when I want to import in-parameters in a child workflow.

During my workflow, one string is initialize with a number (strValue). I‘ve checked that the value is correctly set (System.debug(strValue)).

Later in my workflow, it’s launching a child workflow which needs this string (strValue). At this point, I have fatal errors :

  • Workflow has failed : Invalid parameter(s)
  • Validation error for parameter ‘strValue’ : Mandatory field not set
  • Workflow has failed : validation error

If I hard-code the value “strValue” in the attributes tab in my workflow, I don’t experience the error. The same if I transform “strValue” as a worklow input and enter it in the presentation view when I submit my workflow to start.

Any ideas how to avoid such errors ?

Thank you for your inputs.

Fred

0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

OK, validation issue at runtime on the subworkflow. My previous statement was only valid for running a validation on the parent workflow.

Include a System.log(System.getObjectType(strTaskID)); in the scriptable box before the subworkflow that fails.

If it does not come as a string you will need to cast when assigning to the value with adding + "";

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

0 Kudos
5 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Hi,

Could you please provide a sample package with 2 workflows having the problem ?

The validation does not check the content of your variables, it checks the binding (must be bound and with the same type).

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
fredoenglish
Contributor
Contributor
Jump to solution

Christophe,

I've not added the full package but I've done screenshots of all my workflow... Hope this helps.

Many thanks..

Regards,

Fred

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

OK, validation issue at runtime on the subworkflow. My previous statement was only valid for running a validation on the parent workflow.

Include a System.log(System.getObjectType(strTaskID)); in the scriptable box before the subworkflow that fails.

If it does not come as a string you will need to cast when assigning to the value with adding + "";

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos
fredoenglish
Contributor
Contributor
Jump to solution

Christophe,

Thank you very much for your answer. I've included System.log(System.getObjectType(strTaskID)) and it came as a "number". I've cast my value and it worked !

Is-it not strange that attribute change during workflow even if it's declared as a String in the attribute tab? Moreover, "Invoke AddDeviceToScheduleTask" worked but it's just the Invoke "StartTaskNow" which didn't work.... Anyway, all is now working fine !

Many thanks,

Regards,

Fred

0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

JavaScript is not strongly typed. Initializing the string may have helped avoid this. The types in vCO are mostly visual helpers to bind parameters.

These are not checked when getting out from one box but are checked through the inptut validation.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
0 Kudos