Previous Topic: Implementing in Java or JavaScript ConsiderationsNext Topic: Exception Handling In Scripts


How You Pass Data to and from Scripts

You can execute either of the following formats of script (as reflected in the opbindings.xsd XML schema definition):

  1. You can define one or more global scripts at the head of the opbindings XML file.

    As a result, the individual bindings cause the execution of individual functions within these scripts. When this style is used, the exact same arguments passed to the attribute-style processor's method are passed to the corresponding target scripting function. For example, a scripting function targeting an ADD operation are passed an ObjectInfo instance as its first argument, and an Attributes object as its second argument. This is because these are the arguments to com.ca.jcs.processor.OpProcessor.doAdd(ObjectInfo, Attributes). Use this approach for all but the simplest scripts, as it allows reuse of utility functions between multiple scripts.

    Note: For more information about the arguments passed to other methods, see the JavaDocs in the CA IdentityMinder bookshelf for the com.ca.jcs.processor.OpProcessor interface. For an example of a script function targeting a MODIFY operation, see com.ca.jcs.processor.OpProcessor.doModify(ObjectInfo, ModificationItem[]) in the CA IAM CS Javadoc in the CA IdentityMinder bookshelf.

  2. Alternatively, each opbinding can be tied to a complete self-contained script (instead of to a function contained with a script). In this case, each of the arguments to the attribute-style processor's method are bound to script variable names using the exact arguments names and Java structures as defined in the OpProcessor's JavaDoc. For example, a script targeted an ADD operation doAdd(ObjectInfo objInfo, Attributes attrs) are called with two scripting variables defined:

For both formats, the following additional scripting variables are also bound:

Note: For more information about query-related scripting variables and other notes on queries, see LOOKUP and SEARCH query operations through Script opbindings Considerations.

Only script opbindings that have their executedDirectly Boolean field set to false require a connector to have a script-style processor. As such, opbindings produce connector-specific text (for example, SQL for the JDBC connector) which only the connector knows how to execute. The CA IAM CS framework invokes all other opbindings without any special support being required from the target connector.