Workflow Functions

Description of built-in Workflow Functions that can be used to perform specific actions relative to a service, contract, or policy.

Table of Contents

Introduction

The Policy Manager Workflow Library includes a series of built-in functions that are used to perform specific actions relative to a service, contract, or policy. Some functions require arguments to control the execution of a function. In addition to the built-in functions, you can also invoke functions bundled with OSWorkflow or custom defined functions.

Note: Policy Workflow does not include functions.

General Functions

These workflow functions can be used in any type of Policy Manager workflow.

Function Content
print

Prints out the name/value pairs contained in the <arg> elements to stdout along with a timestamp.

log

Sends a message to the Policy Manager log.

Arguments

message—The message to be logged along with the object the workflow is managing.

severity (optional)—The logging severity for the message: fatal, error, warning, info (default), debug, or trace.

runScript

Runs a script to check for a special condition. For an example, refer to Using Scripts in Workflows.

Note: The workflow runScript function has the following additional features available in process/policy scripting:

  • Support of invoking services via the messengerService.
  • Abillity to define the following variables with function equivalent to process/policy scripting: systemLog, alerter, msgFactory, msgrService.
  • Ability to import script objects.

These changes apply to all types of workflow in both Policy Manager and Community Manager.

Arguments

script-id—An optional, unique identifier assigned to the script. This identifier is used as the key to the compiled script when stored in memory for reuse. This is useful for scripts that occur within workflow <step> definitions as opposed to those that appear in <common-functions>.

Example:

<arg name="id">script-id</arg>

import—An optional list of script objects that are to be imported into this script definition. These script objects must use the same scripting language as the workflow script.

Example:

<arg name="import">
	script-object-key ...
</arg>

useLegacy—An optional flag that enables the older style script variables to be set in addition to the new ones. This allows compatibility with existing scripts.

Example:

<arg name="useLegacy"> true | false </arg>

For additional information on the enhanced runScript functionality, see Using Scripts in Workflows.

getOrganizationemailContact

Produces a comma-delimited list of organization contact email addresses.

Arguments

organization (optional) —The UDDI key of the organization whose email contacts are to be retrieved. Defaults to the parent organization of the service or contract.

contactType—A comma-delimited list of organization contact use types that are to be selected.

emailType (optional)—A comma-delimited list of organization contact email use types that are to be selected.

variable (optional)—The name of the workflow variable that is to hold the resulting list of email addresses. This name must not contain a period. The default is to use the first value in the contactType argument

email

Generates and sends an email message.

Arguments

smtpHost (optional) —The host name of the SMTP server. Defaults to the global mail server configured in Policy Manager.

to—A comma-delimited list of recipients.

from—The value to be used as the email sender.

cc (optional)—A comma-delimited list of copy recipients.

subject—The subject line of the message.

message—The body of the message.

priority (optional)—The priority of the message: high, medium, low. Default is medium.

parseVariables—Should ${…} variables be resolved in the following arguments: to, cc, subject, message.

Service-Specific Functions

The following workflow functions are used in Service Workflow definitions.

Function Content
addCategory

Adds a new keyed reference entry in the service's UDDI category bag.

Arguments

tmodel—The UDDI tModel key of the new keyed reference.

keyName (optional)—The name of the new keyed reference.

keyValue—The value to be placed in the new keyed reference.

deleteCategory

Removes the specified keyed reference from the service's UDDI category bag.

Arguments

tmodel—The UDDI tModel key of the keyed reference to be removed.

keyValue—The key value of the keyed reference to be removed.

setUniqueCategory

Adds a new keyed reference entry in the service's UDDI category bag after deleting any entries with the same tModel key.

Arguments

tmodel—The UDDI tModel key of the new keyed reference.

keyName (optional)—The name of the new keyed reference.

keyValue—The value to be placed in the new keyed reference.
setLifecycleStage

Sets or updates the lifecycle stage value in the service's category bag. This value appears in the Service Overview section of the Service Details page.

Arguments

stage—The value of the new service lifecycle stage.

publish

Sets the publish flag for the service.

Note: Akana does not recommend using this function because the only thing it does is disable the workflow-based service access control. Also, once this flag is set, there is no way to turn it back off to restore workflow access control.
getCategoryValue

Placed the key value of a keyed reference selected from the service's category bag into a workflow variable.

Arguments

tmodel—The UDDI tModel key of the keyed reference.

keyName (optional)—The name of the keyed reference.

var—The name of the workflow variable to receive the key value of the selected keyed reference. Do not include any periods in this name.
getCategoryValueFromProxiedService

Placed the key value of a keyed reference selected from the proxy parent service's category bag into a workflow variable.

Arguments

tmodel—The UDDI tModel key of the keyed reference.

keyName (optional)—The name of the keyed reference.

var—The name of the workflow variable to receive the key value of the selected keyed reference.

Note: Do not include any periods in this name.

handle.errors [lax | strict]—Generate warnings or errors when used on a non-proxy service.

copyCategoriesToProxyServices

copyCategoriesFromProxiedService

Copy selected keyed reference from the service's category bag to the category bag of its proxy virtual service.

Arguments

include—A list of tModel keys of the categories to be included. The default is to include all non-reserved categories.

include.groups A list of tModel keys of the category groups to be included

exclude—A list of tModel keys of the categories to be excluded.

exclude.groups—A list of tModel keys of the category groups to be excluded

replace A list of tModel keys of the categories to be completely replaced in the proxy service

replace.groups—A list of tModel keys of the category groups to be replaced in the proxy service.

recursive (copyToProxyServices only) —Should the selected categories be copied to the entire chain of services (true) or to just the direct proxies (false=default) These arguments are whitespace-delimited lists of UDDI keys. The entries can contain a wildcard (*) at the beginning, the end, or both.

exportService

Exports the service as a ZIP archive in a designated location on the Policy Manager server.

Argument

One of the following:

export.file—The fully qualified name of the export ZIP.

export.folder—The directory where the export ZIP will be placed. The default is [Akana-HOME]/{pm_version}/export.

The file will be named service-[service-uddi-key]-export.zip

include.artifacts —Specifies what is to be included.

include.operational.policies—In the service export (the default).

include.qos.policies—Is to include everything

include.compliance.policies

include.pki.keys

If the export file already exists, it will be kept but renamed to include a date/time stamp.
exportProxyServiceChain

Exports a Proxy Virtual Service along with its entire chain of proxied parent services.

This function has the same set of arguments as the exportService function. The default name of the export ZIP archive will be:

servicechain-[service-uddi-key]-export.zip

exportProxyServiceChain

Exports a Proxy Virtual Service along with its entire chain of proxied parent services.

This function has the same set of arguments as the exportService function. The default name of the export ZIP archive will be:

servicechain-[service-uddi-key]-export.zip

performActionOnProxyServices

performActionOnProxiedService

Perform a workflow action on the related proxy or proxied parent service.

Arguments

One of the following:

action.id—The id of the workflow <action> to be performed.

action.name—The name of the workflow <action> to be performed.

action.message—An optional comment that will be logged with the workflow history of the action event.

handle.errors [lax | strict]—Generate warnings or errors when the specified action is not part of the target service's current workflow <step>.

recursive—(performActionOnProxyServices only) Should the action be performed on the entire chain of services (true) or to just the direct proxies (false=default).

Additional arguments can be passed and will be available as workflow variables for use in the target action. The names of these additional arguments must not contain any periods (.)

performAction

Perform a workflow action on the service with the same key but in a remote Policy Manager instance.

Arguments

One of the following:

action.id—The id of the workflow <action> to be performed.

action.name—The name of the workflow <action> to be performed.

action.message—An optional comment that will be logged with the workflow history of the action event.

handle.errors [lax | strict]—Generate warnings or errors when the specified action is not part of the target service's current workflow <step>.

One of the following:

workflow.service.key—Specify the instance of the

workflow.service.qname—Workflow Service for the remote

workflow.service.binding.identifier—Policy Manager

workflow.service.username—The user on the remote Policy Manager to use to perform the action. This is either a qualified user name (domain\user) or a user in the Local Domain.

workflow.service.password—The password for that user.

remote.transport.method—The strategy to be used to transmit the perform-action request to the remote Policy Manager:

  • sync(default) Function does not complete until the action has been completed on the remote Policy Manager.
  • async—Function completes immediately and the perform-action request is placed on a persistent queue to be processed by a background thread.

Additional arguments can be passed and will be available as workflow variables for use in the target action. The names of these additional arguments must not contain any periods (.)

Contract-Specific Functions

The following workflow functions are used in Contract Workflow definitions.

Function Content
version

Moves the contract from the Draft state to the Active and Activated state.

deactivate Moves the Active and Activated contract to the Active but Deactivated state.
activate Moves the Active but Deactivated contract to the Active and Activated state
exportContract

Exports the contract as a ZIP archive in a designated location on the Policy Manager server.

Argument

One of the following:

export.file—The fully qualified name of the export ZIP.

export.folder—The directory where the export ZIP will be placed. The default is [Akana-HOME]/sm60/export.

The file will be named: contract—[contract-key]-export.zip

include.artifacts—Export attached metadata (default=true).

include.qos.policies—Export any attached QoS policies (default=true).

If the export file already exists, it will be kept but renamed to include a date/time stamp.

performAction

Perform a workflow action on the contract with the same key but in a remote Policy Manager instance.

Arguments

One of the following:

action.id —The id of the workflow <action> to be performed.

action.name—The name of the workflow <action> to be performed.

action.message—An optional comment that will be logged with the workflow history of the action event.

handle.errors [lax | strict]—Generate warnings or errors when the specified action is not part of the target contract's current workflow <step>.

One of the following to specify the instance of the Workflow Service for the remote Policy Manager:

  • workflow.service.key
  • workflow.service.qname
  • workflow.service.binding.identifier

workflow.service.username—The user on the remote Policy Manager to use to perform the action. This is either a qualified user name (domain\user) or a user in the Local Domain.

workflow.service.password—The password for that user.

remote.transport.method—The strategy to be used to transmit the perform-action request to the remote Policy Manager:

  • sync—(default) Function does not complete until the action has been completed on the remote Policy Manager.
  • async—Function completes immediately and the perform action request is placed on a persistent queue to be processed by a background thread.
Additional arguments can be passed and will be available as workflow variables for use in the target action. The names of these additional arguments must not contain any periods (.)