Can not pass an object of type to the void workflow.

Hello

I want to do a log of every action in an external file.

In an action, I create an object of type FileWriter(). Opening the connection and then returning this object from main workflow.

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

Also, main workflow has a workflow of void. I'm passing 'logFile' object for this void as an input workflow to collect newspapers. But I get an error saying:

"TypeError: can't call method"writeLine"null".

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

It works for variables of type object, not as a number, String, composite type etc.

Kind regards

Shubahda

Reflection, I think now this behavior is probably normal/expected.

FileWriter objects are objects that are not serializable/searchable script. I'll check with colleagues who are more familiar with the implementation of the transition from setting how such objects can be manipulated (maybe there's a way to wrap them up other than "Any"), but it will happen after the holidays.

In the meantime, do you really need to pass objects FileWriter autour? Is it possible to have an action of logging, accepting as inputs the message and (possibly) means the name of the log file, which will open the log file, write the message and close the log file? And call this action in any workflow job/slot-workflow/scripts box where you want to save something. Yes, the log file will be opened/closed frequently (for each log message), but the drop in performance should not be so great.

Tags: VMware

Similar Questions

Maybe you are looking for