gbeke
Enthusiast
Enthusiast

TypeError: Cannot call method "get" of null

Jump to solution

Hi,

This question should maybe be posted in the Orchestrator forum, but I´ll try here first. I´m running a workflow as a post machinebuilding event and in the the script I have defined payload as a input. The first line of the script is "var machine = payload.get("machine");" and it generates the following error "TypeError: Cannot call method "get" of null".

I´m using the exact same line in a pre machinebuilding event and it works fine. My first thought was that "machine" is not available but it does seems to be available since I see this in the logs "'attribute': name=machine type=string" with the correct values.

I am hoping someone can help me with this problem. If more information is needed, please let me know.

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
gbeke
Enthusiast
Enthusiast

It turns out that lack of knowledge was the issue. I was not aware that when using the payload input parameter it can be the only input parameter in the workflow. After removing the other input parameters I get the payload.

View solution in original post

0 Kudos
3 Replies
SimonLynch
VMware Employee
VMware Employee

Can you confirm your passing through the properties on the state using  Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvsioned *

Also check the input type for the payload is the right type

0 Kudos
gbeke
Enthusiast
Enthusiast

SimonLynch​, thanks for taking time to try to help me.

Yes, the properties Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvsioned * is defined as a property on the blueprint. Input type for payload is "Properties". Like I mentioned I have a prebuilding script that is setup the same way with regard to Extensibility properties and the payload parameter and that works just fine.

The Workflow execution stack includes a line that says 'attribute':name=machine type=string value=["values listed"] where "value listed" includes the information that I expect to be in the payload, such as machine name, network configuration, owner, Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned etc.

0 Kudos
gbeke
Enthusiast
Enthusiast

It turns out that lack of knowledge was the issue. I was not aware that when using the payload input parameter it can be the only input parameter in the workflow. After removing the other input parameters I get the payload.

0 Kudos