C Automation: Start to Finish

This appendix provides steps to define a basic automation in Oracle Communications Design Studio, starting with a new cartridge and finishing with triggering the automation in Oracle Communications Order and Service Management (OSM) following deployment of the cartridge to the OSM server. The information is presented in the form of high-level steps. For specific instructions on how to perform each individual step, see the Design Studio Platform Help and the Design Studio Modeling OSM Processes Help.

Note:

This appendix assumes that you have read "Using Automation."

Assumptions

The steps presented in this appendix assume that you have the following applications installed:

  • Eclipse

  • OSM Plug-ins

  • OSM Administrator

  • OSM

Getting Started

This section describes creating a new cartridge in Design Studio and compiling the project, prior to defining the automation. This section provides information that is used regardless of the automation example.

The creation of a new cartridge results in the creation of an Order entity of the same name within the cartridge. For example, if you create a new cartridge cartridgeName, an Order entity is created within the cartridge named cartridgeNameOrder. On the Order editor Details tab, three fields must be defined:

  • Life-cycle Policy

  • Default Process

  • Creation Task

Until these fields are defined, the following errors are present for an order:

  • Order Model Error: Creation task is not defined for order cartridgeNameOrder.

  • Order Model Error: Default process is not defined for order cartridgeNameOrder.

  • Order Model Error: No roles have been granted for Creation permissions for this order.

  • Order Model Error: Order Life-cycle Policy is not defined in workspace.

  • Order Model Error: Order cartridgeNameOrder has empty Order Template.

  • Order Model Error: There is no Permission defined for order cartridgeNameOrder.

The following steps walk you through creating a cartridge to resolve these errors:

  1. Create a new cartridge.

  2. Build the project.

  3. Open the Problems view.

    You may see the errors listed above.

  4. Create a Role.

    You must create a role first because every entity you create requires that permissions be set, which is done by assigning a role.

  5. On the Role editor, select the appropriate permissions.

  6. Save the role.

  7. Create an Order Life-cycle Policy.

  8. On the Order Life-cycle Policy editor Permissions tab, set permissions for the order life-cycle policy by assigning a role.

  9. Save the order life-cycle policy.

  10. Create a process.

  11. On the Process editor Permissions tab, set permissions for the process by assigning a role.

  12. Save the process.

  13. Create a manual task.

  14. On the Manual Task editor Permissions tab, set permissions for the task by assigning a role.

  15. Save the task.

  16. On the Order editor Order Template tab, define an order template.

    This can be done by defining elements in the Data Dictionary and adding them to the order template, or by importing an order template. For purposes of understanding a basic automation, you may just want to define a few fields, such as name, address, city, state.

  17. On the Order editor Details tab, set the following fields:

    • Life-cycle Policy

      Select the life-cycle policy you created in step 7.

    • Default Process

      Select the process you created in step 10.

    • Creation Task

      Select the task you created in step 13.

  18. On the Order editor Permissions tab, set permissions for the order by assigning a role.

  19. Save the order.

  20. Build the project.

    Upon successful build, the Problems view shows that all errors are resolved.

Defining an Automated Task

At this point, you have a cartridge that defines an order within a project that compiles.

This example is using an automated task to trigger the automation, so this section describes the high-level steps for defining an automated task:

Note:

An automation can also be triggered by a notification.

  1. Define an automated task.

  2. On the Automated Task editor Permissions tab, set permissions for the process by assigning a role.

  3. Save the automated task.

Writing the Custom Automation Plug-in

This section describes the high-level steps for writing a basic custom automation plug-in:

  1. In the cartridgeName/src directory, create a new Java source file.

  2. Write the Java code where the class extends AbstractAutomator.

  3. This automation is being triggered by an automated task, so the Java code can expect the TaskContext object as an input parameter. Code something simple, such as:

    • Cast the TaskContext object to a local variable

    • Print out a data value that is available through the TaskContext object. (This example had an order template that defined name, address, city, state, and zip, which would be available through the TaskContext object.)

    • Complete the task by calling the method on the TaskContext object.

  4. Compile the source file.

    The resultant compiled class file now resides in the cartridgeName/out directory.

Defining the Custom Automation Plug-in

This section describes the high-level steps for creating a Custom Automation Plug-in that is the Design Studio entity representation of your custom automation plug-in.

  1. Create a Custom Automation Plug-in:

    1. Provide a name for your Custom Automation Plug-in.

    2. Select your custom automation plug-in class name.

    3. In the XML Template field, define the implementation of your custom automation plug-in using the <implement> element. See "AutomationMap.xml File" for examples of defined <implement> elements.

    4. In the cartridgeName/customAutomation directory, create a corresponding schema file that defines the rules for the XML you defined in the XML Template field.

  2. Save the Custom Automation Plug-in.

Defining the Automation

This section describes the high-level steps for defining the automation, which maps your automated task to your Custom Automation Plug-in.

  1. Open the automated task editor for the automated task you created.

  2. On the Automated Task editor Automation tab, define the automation:

    1. In the Name field, enter a name for your automation.

    2. In the Automation Type list, select your custom automation plug-in.

    3. For this example, let the Event Type default to the choice of Internal Event Receiver.

  3. Save the Automated Task.

Defining the Process

This section describes the high-level steps for defining the process, which must include your automated task in order for the task to be initiated and trigger your automation.

  1. Open the Process Editor.

  2. Add your automated task to the process.

    For the project to compile, and for your automation to run, your process must define a Start node, your automated task, an End node, and statuses between the three.

  3. Save the process.

Building the Cartridge

After you have completed these steps, you must build the cartridge project. A successful build of the project results in the generation of the automationMap.xml file.

Packaging and Deploying the Cartridge

This section describes the high-level steps for deploying the cartridge to the OSM server, including what must be done prior to deployment. For more information, see the Design Studio Help topic about packaging and deploying OSM cartridges.

  1. Create an Environment Design Studio entity, which defines the connection information for the server hosting the OSM environment to which you plan to deploy your cartridge.

  2. Deploy the cartridge to your OSM environment.

Triggering the Automation in OSM

The final step is to trigger the automation from within OSM; this can only occur after the cartridge is successfully deployed to the OSM server.

  1. Within OSM, create an order based on the order template that you defined in your cartridge.

  2. Save the order.

    This results in the order starting to process. The order process you defined, which includes the automated task you defined, starts processing: First, the creation task runs.

  3. Complete the creation task.

    (This example defined the creation task as a manual task, so you must manually complete the creation task.)

    When the creation task is completed, the next task defined in the process is created, which is your automated task. The creation of the automated task sets the task state to Received, which triggers your automation to run.