VMware Cloud Community
ShubhadaS
Contributor
Contributor
Jump to solution

Can not pass an object of type Any to the sub workflow.

Hi,

I want to make a log of each action in an external file.

In an action I am creating an object of type FileWriter(). Opening the connection and then returning this object to main workflow.

In main workflow we catch the output of the action in 'logFile' variable which is declared as an attribute of type 'Any' .

Main workflow also has one sub workflow. I am passing 'logFile' object to this sub workflow as an input for collecting the logs. But I am getting an error saying :

"TypeError: Cannot call method "writeLine" of null".

So how to send the attributes to the sub workflow in form of an object?

It works for non object type variables like number,string, composite type etc.

Regards,

Shubahda

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

On second thought, I now think this behavior is probably normal/expected.

FileWriter objects are scripting objects that are not serializable/searchable. I'll check with colleagues who are more familiar with parameter passing implementation how such type of objects can be handled (maybe there is some way to wrap them other than 'Any'), but this will happen after holidays.

Meantime, do you really need to pass FileWriter objects around? Is it possible to have a logging action, accepting as inputs the log message and (optionally) the log file name, which will open the log file, write the log message, and close the log file? And call this action in any workflow/subworkflow/scripting box where you want to log something. Yes, the log file will be opened/closed frequently (for each log message), but the performance hit should not be so big.

View solution in original post

Reply
0 Kudos
5 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Looks like a bug to me. I was able to reproduce it in my 5.5u1 dev environment.

Could you open a SR/PR about it?

Reply
0 Kudos
ShubhadaS
Contributor
Contributor
Jump to solution

How to open SR/PR for this issue?

Can you please elaborate the steps?

Regards,

Shubhada

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Well, if you are a VMware customer, the official way is to contact your VMware point-of-contact who will open a SR. If you are a VMware employee, you can open a new PR directly in VMware bug tracking system, and assign it to vCO team.

Or I can open a PR, if it is OK with you?

BTW, which vCO version do you use? And do you want the fix for this issue delivered as part of next update release, or as a custom patch? For custom patches (which are out of release schedule) there should be a SR with high enough priority/severity.

Reply
0 Kudos
ShubhadaS
Contributor
Contributor
Jump to solution


I am using version 5.5.

Can you please open a PR ?

Also, can you provide this as a custom patch for now, and later deliver it as a part of next update release.

Regards,

Shubhada

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

On second thought, I now think this behavior is probably normal/expected.

FileWriter objects are scripting objects that are not serializable/searchable. I'll check with colleagues who are more familiar with parameter passing implementation how such type of objects can be handled (maybe there is some way to wrap them other than 'Any'), but this will happen after holidays.

Meantime, do you really need to pass FileWriter objects around? Is it possible to have a logging action, accepting as inputs the log message and (optionally) the log file name, which will open the log file, write the log message, and close the log file? And call this action in any workflow/subworkflow/scripting box where you want to log something. Yes, the log file will be opened/closed frequently (for each log message), but the performance hit should not be so big.

Reply
0 Kudos