Oracle Waveset 8.1.1 Resources Reference

Using Resource Actions

The Oracle ERP adapter supports resource actions. To enable these actions, you must supply scripts written in Javascript or BeanShell. The adapter calls these scripts before or after performing the following provisioning actions:

Every action script receives an actionContext map, as defined by the java.util.Map class. The possible map content varies for each action.

Scripts should never close the JDBC Connection that is passed to them. The adapter automatically closes the connection at the appropriate time.

See Chapter 51, Adding Actions to Resources for more information about implementing resource actions. Example scripts are provided in $WSHOME/sample/OracleERPActions.xml.

create Before/After Action

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn

java.sql.Connection 

JDBC connection to the customer’s database 

adapter

com.waveset.adapter.OracleERPResourceAdapter 

Adapter instance 

action

java.lang.String 

The createUser string

timing

java.lang.String 

Must be before or after

id

java.lang.String 

Account ID of the user to create 

password

java.lang.String 

If present, this value is the new user’s decrypted password 

attributes

java.util.Map 

Map of attributes to set for the new user. 

  • The key identifies which attribute to set

  • The value specifies the decrypted value to which the attribute should be set.

errors

java.util.List 

Initially, this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace

com.sun.idm.logging.trace.Trace 

Object used to trace execution 

Scripts can use methods from this class to be “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, the script may also add appropriate strings to the errors key. The presence of any items in the errors List is considered a creation failure.

update Before/After Action

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn

java.sql.Connection 

JDBC connection to the database 

adapter

com.wavset.adapter.OracleERPResourceAdapter 

Adapter instance 

action

java.lang.String 

The updateUser string

timing

java.lang.String 

Must be before or after

id 

java.lang.String 

Account ID of the user to update. 

password

java.lang.String 

If present, this value is the decrypted value of the user’s new password. 

attributes

java.util.Map 

Map of attributes to set for the existing user. 

  • The key identifies which attribute to set

  • The value is a decrypted value to which the attribute should be set.

    A missing key means that the attribute is not being updated.

errors

java.util.List 

Initially, this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace

com.sun.idm.logging.trace.Trace 

Object used to trace execution. 

Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, the script may add the appropriate strings to the errors key. The presence of any items in the errors List is considered an update failure.

delete Before/After Action

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn

java.sql.Connection 

JDBC connection to the database 

adapter

com.wavset.adapter.OracleERPResourceAdapter 

Adapter instance 

action

java.lang.String 

The deleteUser string

timing

java.lang.String 

Must be before or after

id

java.lang.String 

Account ID of the user to delete 

errors

java.util.List 

Initially, this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace

com.sun.idm.logging.trace.Trace 

Object used to trace execution. 

Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, the script may add appropriate strings to the errors key. The presence of any items in the errors List is considered a deletion failure.

enable Before/After Action

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn 

java.sql.Connection 

JDBC connection to the database 

adapter 

com.wavset.adapter.OracleERPResourceAdapter 

Adapter instance 

action 

java.lang.String 

The enableUser string

timing 

java.lang.String 

Must be before or after

id 

java.lang.String 

User account ID to enable 

errors 

java.util.List 

Initially, this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace 

com.sun.idm.logging.trace.Trace 

Object used to trace execution. 

Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, the script may add the appropriate strings to the errors key. The presence of any items in the errors List is considered a failure.

disable Before/After Action

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn

java.sql.Connection 

JDBC connection to the database 

adapter

com.wavset.adapter.OracleERPResourceAdapter 

Adapter instance 

action

java.lang.String 

The disableUser string

timing

java.lang.String 

Must be before or after

id

java.lang.String 

User account ID to disable 

errors

java.util.List 

Initially, this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace

com.sun.idm.logging.trace.Trace 

Object used to trace execution. 

Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, the script may add the appropriate strings to the errors key. The presence of any items in the errors List is considered a failure.

getUser After Action

The getUser action is useful in situations where you need to retrieve additional custom account attributes from the database beyond those retrieved by the standard adapter. To enable this action, specify the name of this resource action by setting the resource parameter labeled GetUser After Action.

The actionContext map passed to the action contains the following entries:

Key  

Value Type  

Value Description  

conn

java.sql.Connection 

JDBC connection to the database 

adapter

com.wavset.adapter.OracleERPResourceAdapter 

Adapter instance 

action

java.lang.String 

The getUser string

id

java.lang.String 

The user account ID to fetch. 

currentAttributes

java.util.Map 

Map of attributes to set for the existing user. 

  • The key identifies which attribute to set

  • The value is a decrypted value to which the attriute should be set.

changedAttributes

java.util.Map 

This is passed in as empty map. 

The script can optionally populate this map in order to either: 

  • Add new account attributes to Waveset’s view of the user, or

  • Change the value of account attributes in Waveset’s user view

    The key is the name of the account attribute (as registered in the right-hand side of the schema map). The value is the desired value for the account attribute.

errors

java.util.List 

Initially this value is an empty list. 

The script may add java.lang.String objects to this list if any errors are found during processing.

trace

com.sun.idm.logging.trace.Trace 

Object used to trace execution. 

Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. 

Error Handling

Any throw from within the script is considered a failure.

If the script encounters any errors, it may add appropriate strings to the errors key. The presence of any items in the errors List is considered a fetch failure.