Defining Script Objects
You can assign Microsoft® ActiveX® scripts to method and property definitions in an information model. The repository engine exposes these methods and properties, and invokes the associated script at run time. You can also use scripts to program transient object collections.
You can create script using Microsoft JScript® and Microsoft Visual Basic® Scripting Edition (VBScript). To define scripts in your information model, use the IScriptDef interface for COM programs or the ScriptDef object for Automation programs. Only one script definition can be associated for each method or property.
Attaching scripts to properties that are defined as BLOBs (that is, PropertyDef objects that have SQLType set to SQL_LONGVARBINARY or SQL_LONGVARCHAR) is not supported. Attaching scripts to large property objects does not result in an error or warning; the script is not invoked.
IScriptDef properties do not reside on the IMethodDef or IPropertyDef interfaces by design. Associating a script at the interface or class level allows you to implement the same method in a variety of contexts.
The following topics provide more information about script implementation.
Topic | Description |
---|---|
Binding Scripts | Explains the binding algorithm that links scripts to specific methods and properties |
Accessing a Script | Describes how to access a script |
Predefined Script Variables | Describes variables that you can use when creating a script |
Method Invocation for Scripted Methods | Describes requirements and considerations for invoking a scripted method |
Get Method for Scripted Properties | Describes requirements and considerations for creating the Get function of a scripted property |
Put Method for Scripted Properties | Describes requirements and considerations for creating the Put function of a scripted property |