Oracle Waveset 8.1.1 Resources Reference

Defining Actions

An action has the following structure:

<ResourceAction name=’Name’>
    <ResTypeAction restype=’ResourceType’ actionType=’Language’ timeout=’Milliseconds’>
       <act>
       ...
       </act>
    </ResTypeAction>
 </ResourceAction>

where:

The <act> element defines the action. It contains code that is executed on the resource. For example, the following XML defines an action for a Solaris resource:

<?xml version=’1.0’ encoding=’UTF-8’?>
<!DOCTYPE Waveset PUBLIC ’waveset.dtd’ ’waveset.dtd’>
<Waveset>
    <ResourceAction name=’after-create’>
       <ResTypeAction restype=’Solaris’ timeout=’60000’>
          <act>
          #!/bin/ksh
          echo "$WSUSER_accountId says Hello World!"
          # exit $DISPLAY_INFO_CODE if there is not a failure, but you want
          # the output to be propagated to the UI
          #exit 0
          exit $DISPLAY_INFO_CODE
          </act>
       </ResTypeAction>
    </ResourceAction>
</Waveset>

Note –

The code contained within the <act> elements is the same as seen in a UNIX script (ksh or sh) or a Windows batch script.


Using Environment Variables

Environment variables are exported and available to actions. These comprise any one of the schema-mapped attributes that have values on the user (defined in the resource schema map in the Identity System Resource Attribute column), prefixed by WSUSER_. For instance, the preceding example uses the environment variable WSUSER_AccountId, formed by preceding the AccountId attribute defined in the Solaris resource schema map by WSUSER_. These variables should be identified as environment variables within the respective shell, so that in Solaris, the variable name is preceded by $ (dollar sign).

Because OS/400 does not have variable substitution in its command language, the resource adapter looks for variable names, and carries out the substitution before transmitting the command line to the resource. To make recognition of variables possible, you must add a $ before and after a variable. Specifically, to use WSUSER_AccountId in an OS/400 script, enter the following text in the command line: $accountId$. Note the exclusion of “WSUSER”.

Example usage:

<ResTypeAction restype="OS/400" timeout="6000">
<act>
CRTOUTQ OUTQ(SYSTEME/$accountId$)
</act>
</ResTypeAction>

Implementing After Actions

Waveset only pushes changed attributes to a resource on an update. An action cannot access any attributes that have not changed. If you write an after action that requires an attribute that might be unchanged, consider the following workaround:

ProcedureAccessing Unchanged Attributes

  1. Add an extra attribute to the resource’s schema map that mimics the account attribute that you need to access. For example, if you need to access the fullname account attribute, you could create an attribute named shadow_fullname. In the Resource User Attribute column of the schema map, add the value IGNORE_ATTR. for this new attribute to prevent the adapter from trying to use it.

  2. Set the value in your user form so that the attribute is populated:


    <Field name=’accounts[ResourceName].shadow_fullname’>
        <Expansion>
           <ref>accounts[ResourceName].fullname</ref>
        </Expansion>
     </Field>
  3. Reference %WSUSER_shadow_fullname% in your action so that it can get the value.

    Waveset never retrieves an attribute that is set to IGNORE_ATTR. As a result, Waveset considers the contents of an attribute such as shadow_fullname as a new value. The attribute is always pushed to the adapter and is available to after actions.

Creating an Action File

Keep the following items in mind when creating an action file.

Loading the Action File into Waveset

Follow these steps to import the action into Waveset:

ProcedureImporting the Action File

  1. Log in to the Waveset Administrator Interface.

  2. From the menu bar, select Configure, then Import Exchange File.

  3. Enter or browse for the XML file containing the action, and then click Import.