Getting Started with Processes

Learn about common and operation-specific processes, process management tools, and use cases.

Table of Contents

Overview

The Akana API Platform and Akana Policy Manager allow you to define web service orchestration concepts using an XML-based graphical editor called the Process Palette. Here, you can:

  • Define the sequence of messages as they flow through for each virtual service operation.
  • Configure a variety of different Activities for achieving the results required for each operation.

Let's take a quick walkthrough of the process types and tools available, to get you started.

Process Contexts

There are several approaches to configuring process definitions:

  • You can configure a set of common processes for an organization, using the Add Process function. Common processes are available for all resources within the organization.
  • You can define a process for a specific operation:
    • In Policy Manager, choose Services > Operations > Process or Services > Operations > Fault.
    • In the Community Manager developer portal, go to the API Implementation page.

Referencing a Process

If you define processes at the organization level, you can reference/re-use them at the operation level. This approach is most efficient for processes that might be used multiple times, and can help make your process development cycle more efficient.

Create Common Processes in the Processes folder

The example below shows referencing a process using a Process Activity in the Process Editor.

Referencing a process using a Process Activity in the Process Editor

Referencing a Script

In the same way that you can reuse a process by referencing it, you can also reuse a script.

You can define a series of utility scripts for performing common tasks. To do this:

  1. Add a script:
    • In Policy Manager: Scripts folder
    • In the Community Manager developer portal: Organization > Scripts
  2. In your virtual service operation process definition:
    1. Add a Script Activity.
    2. Import a pre-defined script.
    3. Add a script reference for the function you want to perform.

For example, you might have a requirement to validate some data as part of your process. In this example, you might create a reusable script that includes a function for validating data (validateData), and call the script TestScript. Then, in your process definition, you can import TestScript and reference the function in the script source.

This example is shown below.

Referencing a Script Function

Process Function Reference

The Process Function Reference includes a tour of the Process Editor and descriptions and usage examples for each Activity type. To ensure a smooth process when building your process definitions, familiarize yourself with the functionality, techniques, and rules for using each Activity. For more information, refer to Process Reference.

Policy Manager Scripting API

The Policy Manager Scripting API provides a series of interfaces and classes that you can use to build process-related scripts. You can access this API in the following locations:

  • In Policy Manager: Documentation files in the docs\scriptDocs folder of the Akana Platform Folder.
  • On the Akana Documentation Repository, choose the applicable version: Policy Manager Scripting API.

Process Management Tools

For an overview of all the tools in the Process Palette, and functions that apply to the common process definitions, see Managing Processes.

Example: Adding a Script Activity to an operation

The procedure below walks you through adding a Script activity to a specific operation using the Process Editor. When you've added the script, you can run the operation in Test Client and you will see a new header in the Response/Headers tab.

Example: to add a specific script activity to an operation

  1. Open the Process Editor for a specific operation.
  2. Drag and drop the Script Activity icon to the grid.
  3. Change the arrows so that the order of activity is Receive > Invoke Activity > Script Activity > Reply:
    1. Drag the end arrow from Reply Activity to Script Activity. This directs the Script Activity to execute directly after the Invoke Activity.
    2. Click the center of the Script Activity and drag and drop (draw) a new arrow to the center of the Reply Activity. This directs the Reply Activity to execute after the Script Activity.
  4. Specify values for the Script Activity:
    1. Double-click any activity to go to the Activity Edit page.
    2. From the Language drop-down list, choose JavaScript.
    3. In the Script text box, type or paste the following script:
      var msg = processContext.getVariable("message");
      var headers = msg.getTransportHeaders();
      headers.add("myHeaderName", "myHeaderValue");
      msg.setTransportHeaders(headers);
  5. Click the Save icon (on the palette) to save the data.
  6. Click Cancel to exit the Process Editor and return to the Implementation page.

For additional information on using script activity variables, refer to the Process Editor reference documentation for the Script activity.

What's Next?

Now that you've familiarized yourself with the high-level approach of building processes, and know what reference materials and tools are available, you can start building your processes.