How do you pass a value to a method using $evm.instantiate? What is the syntax?


#1

How do you pass a value to a method using $evm.instantiate? What is the syntax?


#2

@mkanoor Do you have an example?


#3

Yes. I’m calling a new method from Cloud / Orchestration / Provisioning / StateMachines / Provision / update_serviceprovision_status method. This method is called called from a state machine on entry / exit and error like this update_serviceprovision_status(status => ‘Processing Preprovision’). I’m wanting to pass this status on to my new method. I am able to get this standard call to work:

$evm.instantiate("/Core/API/CallBack/CallBack")

What is the syntax if I want to pass a variable into my new method? Thanks!


#4

Found an example here in “Case 3 - Calling from $evm.instantiate”

https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter19/argument_passing_and_handling.html

$evm.instantiate("/Discovery/Methods/ObjectWalker?lunch=salad&dinner=spaghetti")

#5

If there are any embedded spaces in the value you would have to URL encode it so that the space gets converted to %20.