Example: Modeling a Basic Automator Plug-In

This example demonstrates how to configure an Automator plug-in that receives data from an internal OSM JMS queue and updates order data using an XSLT style sheet. In the example, assume that the XSLT style sheet includes conditional logic to apply a level 1 priority to the order if the order is from a specific customer.

This example demonstrates how to:

  1. Create an automated task and add the relevant task data.

  2. Add an automation plug-in to the automated task.

  3. Configure the automation plug-in properties.

Note:

An automated plug-in exists within the context of a Design Studio cartridge project, order, process, and automated task. For purposes of demonstration, this example assumes the existence of multiple Design Studio entities. For example, it assumes the existence of a cartridge project called DSLCartridge, an order called DSLOrder, a process called DSLProcess, and an XSLT style sheet called check_customer.xslt that populates default values in the order data. It assumes that the Data Dictionary includes the two data nodes, customer_name and order_priority. It also assumes that the new automated task will be added to the DSLProcess entity. The naming conventions used in this example are for illustrative purposes only.

Step 1: Creating the automated task

  1. From the Studio menu, select New, then select Order and Service Management, and then select Automated Task.

    The Automated Task wizard is displayed.

  2. In the Automated Task wizard, enter or select the following values:

    • In the Project field, enter DSLCartridge.

    • In the Order list, select DSLOrder.

    • In the Name field, enter Check_Customer.

    See "Creating New Tasks" for more information.

  3. Click Finish.

    The new automated task is displayed in the Automated Task editor.

  4. Click the Task Data tab.

    In this example, you will update the order_priority field with a default value of 1 if the order is from a specific customer.

    Note:

    Normally, the task data includes all of the data that the task requires to complete. To simplify the example, this task includes only the two pertinent fields: customer_name and order_priority. See "Defining Task Data" for more information.

  5. Right-click in the Task Data area and select Select from Data Schema.

    The Select Data Elements dialog box is displayed.

  6. Select the data nodes customer_name and order_priority.

  7. Click OK.

    The two data nodes are displayed in the Task Data area.

  8. Click the Permissions tab.

    On the Permissions tab, you can ensure that only the automation role has permissions for automated tasks. See the note in "Assigning Task Permissions" for more information.

You are now ready to add a plug-in to the automated task.

Step 2: Adding the automation plug-in to the automated task

  1. In the Automated Task editor, click the Automation tab.

  2. Click Add.

    The Add Automation dialog box is displayed.

  3. In the Name field, enter Check_Customer.

  4. In the Automation Type field, select XSLT Automator.

  5. Click OK.

    The Check_Customer plug-in is displayed in the Automation list.

  6. From the Automation list, select the Check_Customer plug-in.

  7. Click Properties.

    The Properties view is displayed showing the automation plug-in properties tabs.

    You are now ready to define the automation plug-in properties.

Step 3: Defining automation plug-in properties

  1. In the Automated Task editor Properties view Details tab, accept the default value in the EJB Name field.

  2. Ensure that the model variable that defaults to the Run As field points to a user name set up in the WebLogic Server Administration console. When you deploy the cartridge, the user in the Run As field is added automatically to the OSM_automation group.

    For more information about users and groups, see the discussion of setting up security in OSM System Administrator's Guide. For more information about model variables, see "Project Editor Model Variables Tab".

  3. Click the XSLT tab.

    On the XSLT tab, you define where the XSLT style sheet is located and the status to set if the automation fails. In this example, you define a location on your local machine where the XSLT file is stored.

  4. Select Absolute Path.

  5. In the XSLT field, enter the location of the XSLT file.

    For this example, enter C:\oracle\user_projects\domains\osmdomain\xslt\DSLCartridge\1.0.0\check_customer.xslt.

  6. In the Exception field, select Failure.

    This field represents the exit status that the plug-in should use if it throws an exception. The options available in this field include any status values you assigned to the task.

  7. Select Update Order.

    This option ensures that the default values obtained from the XSLT style sheet are saved to the order data.

  8. Click Save.

    You have completed the basic configuration for an Automator plug-in defined as an internal event receiver.

Note:

Successful automation requires a complete automation build file in the cartridge. If no automation build file exists, Quick Fix generates one.