Method Invocation for Scripted Methods

Meta Data Services Programming

Meta Data Services Programming

Method Invocation for Scripted Methods

When you provide a script-based implementation for a method, the repository engine selects the script object for the method using a binding algorithm, then invokes the script using the default script engine.

For method invocation to succeed, you must make sure that references in the script correspond to references in the method definition. Specifically, the method name, signature, and returned values that are used to implement the script must be the same as the name and signature of the associated method definition.

When you execute the method, it returns an HRESULT value that is copied into the error object. The method invocation returns this value to the caller.

The method can invoke other methods, including itself. You should exercise caution when invoking a method on itself. Doing so may create a recursive condition that can cause a failure in your application.

See Also

Accessing a Script

Defining Script Objects

Get Method for Scripted Properties

Handling Errors

Predefined Script Variables

Put Method for Scripted Properties