Working with Policies

Overview of Policies

Often, tasks require that actions be automatically triggered by specific workflow events. SAS Workflow Studio provides a way to define these actions through policies. Policies are triggered by events and execute actions. Actions can be configured to perform automated tasks such as the following:
  • Indicate how and when notifications of deadlines should be sent.
  • Notify the task owner of related task events such as task start or task stop.
  • Notify users of arbitrary task events such as task start, task stop, or data object updates.
  • Integrate the system with other back-end systems.
A task might initiate multiple actions simultaneously, so you can associate multiple policies with a single task.
Note: A policy encapsulates executable business logic. Business data should not be defined within a policy. Data objects should be used to hold relevant business data in the workflow. Data objects can be updated within policies. However, in general, policies should be limited to actions and not used for data management.
Note: Policies are asynchronous and are subject to timing for execution order. For example, you might use a policy to copy the value from a root data object to a local task data object. In this case, the source object must be set and must not be subject to change.

Adding Policies to a Workflow

To define a new policy, follow these steps:
  1. In the workflow tree, right-click the top-level or local Policies folder in the workflow tree and then select New Policy.
    Alternatively, right-click a task in the diagram editor and then select the New Policy menu option.
  2. In the Edit Policy dialog box, select the desired values:
    Name
    specifies the name of the policy. The name is required.
    Description
    specifies the policy description. Specifying a description is optional.
    Event
    specifies the workflow event that triggers the policy. The event is required. See Policy Events for more information.
    Action
    specifies the policy type. Most policy types require that you specify additional values, and the Edit Policy dialog box displays the Properties section for the type that you selected. The action is required. See Policy Actions for more information.
  3. Enter the required property values for the policy type that you selected.
    Note: Some of these properties provide a text editing tool. Others use the selection button to access data objects visible to the policy.
  4. Click OK to save the policy definition.

Editing Policies

To edit an existing policy, follow these steps:
  1. In the workflow tree, open the Policies folder.
  2. Right-click on the desired policy node and then select Edit.
  3. Changed the desired values in the Edit Policy dialog box.
  4. Select OK to save the changes to the policy definition.

Deleting Policies

To completely remove a policy from the workflow, follow these steps:
  1. Right-click on the target policy in the workflow tree and then select Delete.
    Alternatively, select the policy directly in the workflow tree and press the Delete key or CTRL+X.
  2. Select Yes in the confirmation dialog box to permanently remove the selected policy.

Assigning Policies to a Task

To assign a policy to a task, drag the desired policy from the workflow tree to the relevant task in the diagram editor.
Alternatively, you can copy or drag the policy element into the Policies folder for the target task in the workflow tree. To reuse a global definition of a policy, copy the policy element. To demote a global definition to a local definition, drag the policy element.

Policy Events

The following events can be used to trigger policies:
Task Started
Generated when the task state changes to Started.
Task Finished
Generated when task state changes to Finished.
Status Addition
Generated when the specified status is added to task. When no status is specified (when the default --- is selected), the associated policy is executed for any status addition.
Status Removal
Generated when the specified status is removed from a task.
Timer Expired
Generated when a timer associated with a task fires.
Data Object Updated
Generated when a data object is updated. When no data object is specified (when the default --- is selected), the associated policy is executed for any data object update. See Policy Events and Scope for additional information.
Participants Updated
Generated when the participants list of the task is updated.

Policy Events and Scope

Except for Data Object Updated events, the scope of all events is local to the task that contains the policy.
The scope of a Data Object Updated event starts at the point where the data object that triggers the event is defined and propagates up the workflow tree. Therefore, a policy triggered by a Data Object Updated event must be defined at the same level or above the affected data object.

Policy Actions

Entering Data for Policy Actions

In the dialog boxes for defining policies, if a field is required, the name of the field is in bold type.
Many fields in the policy action dialog boxes have buttons such as the Ellipsis button, the search button, or the browse button that can display a list of valid values for that field. However, in order for these buttons to be able to display the information, you must be logged on to the SAS Server.

Add Status to External Workflow

The Add Status to External Workflow policy is used to propagate the selected status between workflow instances. The referenced data object can be updated while the parent workflow is active.
The following properties can be defined for this policy:
Property Name
Description
Workflow ID Data Object
Specifies the element path to a data object that contains the ID value of the target workflow.
Status Label
Specifies the element path to the status that is added to the target task.

Add Status to Task

The Add Status to Task policy is commonly used to add a status to the current task, thus automating itself based on the event trigger. This can include the Task Started event trigger, if the task is designed to trigger other policies and then stop itself.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path of the task or subflow to which the status is added.
Status
Specifies the element path of the status to be added.

Copy Data Object

The Copy Data Object policy is used to copy values between data objects.
The following properties can be defined for this policy:
Property Name
Description
Source Data Object
Specifies the element path of the data object whose value is to be copied.
Target Data Object
Specifies the element path of the target data object where the value is to be copied.
Note: This policy action triggers a Data Object Updated event. See Policy Events and Scope for additional information.

Copy Data Object from External Workflow

The Copy Data Object from External Workflow policy is used to copy a data object value from another instance (remote or external) into the current workflow.
The following properties can be defined for this policy:
Property Name
Description
Source Workflow ID Data Object
Specifies the element path to a data object that contains the workflow ID value of the source workflow.
Source Data Object Label
Specifies the element path of the external data object whose value is to be copied.
Target Data Object
Specifies the element path of the target data object in the current workflow where the value is to be copied.
Note: This policy action triggers a Data Object Updated event. See Policy Events and Scope for additional information.

Copy Data Object to External Workflow

The Copy Data Object to External Workflow policy is used to a copy data object values from the current instance to another workflow instance (remote or external).
The following properties can be defined for this policy:
Property Name
Description
Source Data Object
Specifies the element path of the local data object whose value is to be copied.
Target Workflow ID Data Object
Specifies the element path to a data object that contains the workflow ID value of the target workflow.
Target Data Object Label
Specifies the element path of the target data object where the value is to be copied.
Note: This policy action triggers a Data Object Updated event. See Policy Events and Scope for additional information.

Copy Participants to Task

The Copy Participants to Task policy is used to copy participant values between tasks.
The following properties can be defined for this policy:
Property Name
Description
Source Task
Specifies the element path of the task from which the participant is copied.
Source Role
Specifies the workflow role that is copied from the source task.
Target Task
Specifies the element path of the task to which the participant is copied.
Target Role
Specifies the workflow role for the target task.
Note: Swimlanes also affect participant values via the Set Participant policy. So, if the task that triggers the Copy Participant to Task policy transitions into a swimlaned task, then a race condition occurs because all policies are asynchronous. In this case, the values are mutually exclusive, so the result is either the copied one or the swimlane one. You should avoid this situation or ensure that the participant values match.

Extract from XML Data Object

The Extract from XML Data Object policy is used to extract the values from an XML type data object and assign it to another data object. XML data objects are commonly used as the output of a web service invocation. See Invoke Web Service for details.
The specified XPath expression is applied to the XML value stored in the data object, and the result is returned as text. If the result of XPath extraction is an array, then the first member in the array is returned.
The following properties can be defined for this policy:
Property Name
Description
XML Data Object
Specifies the element path to the data object that contains the XML value from which the value is extracted.
Output Data Object
Specifies the element path to the data object to which the extracted text value is stored.
XPath Statement
Specifies the statement that is used to extract the desired text from the data object specified in the XML Data Object property.
In the following example, the XML data object has the value:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
   <book>
      <title lang="en">Harry Potter</title>
      <author>J K. Rowling</author>
      <year>2005</year>
      <price>29.99</price>
   </book>
</bookstore>
If the policy specifies /bookstore/book/title for the XPath Statement property, then the policy stores the value Harry Potter in the target data object.
If the XML schema includes namespace prefix notations, then you should declare and use the namespace in the XPath expression in a manner similar to the following:
declare namespace n =
 "http://support.sas.com/xml/namespace/biwebservices/webservicemaker-9.2";
/n:ListWebServicesResponse/n:ListWebServicesResult/n:string

HTTP Request

The HTTP Request policy is used to invoke an HTTP method using the information specified in the policy definition.
The following properties can be defined for this policy:
Property Name
Description
Directive Name
Specifies the name of the directive. The value can be specified using data object substitution. (See Data Object Substitution.) If you are logged on to the SAS platform, you can click Ellipsis to display the list of registered directives.
URL
Specifies the target URL to invoke, execute, or access. The value can be specified using data object substitution.
If the value contains non-ASCII characters, you should select Encode the data objects in the URL when the policy executes. See the standard for Uniform Resource Identifier (URI): Generic Syntax at http://tools.ietf.org/html/rfc3986 for information about character encoding.
Parameters
Specifies any required additional HTTP parameter values. The value can be specified using data object substitution.
Status Code Data Object
Specifies an optional data object to hold the value of the return code of the HTTP request.
Disable Authentication
Specifies whether the proxy ticket for the HTTP request URL should be generated.
Selecting Disable Authentication prevents the HTTP request policy from generating a proxy ticket to add to the URL.
This URL can be an absolute (or complete) URL that includes the host and port, or it can be a relative URL. If a relative URL is specified, then the policy uses the same host and port that the Workflow Service is configured to use.
If the URL is not specified or if it references a data object that contains an empty value, then the Directive Name property is used to create the appropriate URL. The policy retrieves the named directive from the SAS Directive Service, and uses it to build the URL. If a URL is specified, it is combined with the directive. If the Parameters field is specified, then it is appended to the URL value. The policy execution always uses the trusted user identity. See Policy Usage Examples for a detailed example.
Note: Only the POST method is supported.

Increment Data Object

The Increment Data Object policy is used to increment a numeric data object.
The following properties can be defined for this policy:
Property Name
Description
Data Object
Specifies the element path to a data object to be incremented.
Increment Value
Specifies the numeric value by which the data object should be incremented. The default value is 1. Using operand substitution in place of a value is also supported.

Invoke REST Web Service

The Invoke REST Web Service policy is used to invoke a REST web service over HTTP.
The following properties can be defined for this policy:
Property Name
Description
Web Service Location
Specifies the URL of the web service endpoint. The value can be specified using data object substitution. (See Data Object Substitution.) If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of all of the registered REST web services.
HTTP Method
Specifies the HTTP method for the web service. Specify GET, PUT, POST, or DELETE.
Content Type
Specifies the type of the body of the request. The content type is used for POST and PUT requests only. The value can be specified using data object substitution. If no content type is specified, the default value is “text/plain”.
Web Service Input
Specifies the Text data object used for input. The content of the data object can use data object substitution. The value of the Text data object should contain the body of the REST request message.
Web Service Output
Specifies the Text data object used for output. The value of the Text data object contains the body of the REST response message.
Error Values
Error Code
Specifies the data object (number type) for storage for the code value in the case of an error.
You can click the ellipsis icon to display a list of the existing Number data objects.
Error Message
Specifies the Text data object for storage for the message value in the case of an error.
You can click the ellipsis icon to display a list of the existing Text data objects.
Authentication
User Name
Specifies the user name. The value can be specified using data object substitution. If you are logged on to the SAS platform, you can click the ellipsis icon to search for registered users.
If a value is specified, then security-level headers are added to the request at the transport level.
Note: The user name and password properties are required only if the target service mandates access control.
Password
Specifies the password. The value can be specified using data object substitution.
If this property is specified, then it is used in the security-level headers on the web service request.
Note: The user name and password properties are required only if the target service mandates access control.
Note: This policy requires a single output object for storage of the web service response. If the web service does not define a response, then there is no way to verify that the invocation succeeded. Also, if a fault occurs, then the response object is not set, and the error code and message values are stored in the specified error data objects.

Invoke SAS Code

The Invoke SAS Code policy is used to execute SAS code stored in a SAS program. The SAS program can return only a single value to the workflow.
The following properties can be defined for this policy:
Property Name
Description
SAS Source Code
Specifies either a file URI or a URL that is the name of the file that contains the SAS code to execute.
The value can be specified using data object substitution. (See Data Object Substitution.)
Server
Specifies the name of the Workspace Server to use to execute the SAS code.
The value can be specified using data object substitution.
Repository
Specifies the name of the metadata repository in which the Workspace Server is defined.
The value can be specified using data object substitution.
Pass all root data objects?
Controls the scope of root data objects when executing the SAS code.
If this property is checked, then each root-level data object is converted to a macro variable. The macro variables are available for use within the SAS code. Each macro variable is prepended to the SAS code before the code is submitted to the server for processing. See “Macro Name Generation Rules” for more information.
Mappings
Macro Variable Name
Enables you to add a macro variable to the list of SAS Macro Variables. Enter the name of the macro variable in the field, and click Add. Macro variable names are limited to 32 characters. Values can be specified using data object substitution.
Data Object and Task
Lists the data objects, with their associated tasks, that have been defined for the workflow. You can use the arrows (the up arrow and the down arrow) to reorder the data objects in this list. See “Mapping Data Objects to SAS Macro Variables” for more information.
SAS Macro Variable
Lists the SAS macro variables that have been defined for this workflow. Click the delete icon to delete a macro variable from the list. See “Mapping Data Objects to SAS Macro Variables” for more information.
Macro Name Generation Rules
When root data objects are passed in, the macro name generation rules are as follows:
  • All macro variable names are case-insensitive.
  • A single underscore is defined as the default prefix character when forming macro variable names.
For example, if a root data object is defined with the name category and a value of sales then the following macro variable definition is submitted:
%let _category=sales;
To customize the default prefix, follow these steps:
  1. Open SAS Management Console and navigate to Configuration Managerthen selectSAS Application Infrastructurethen selectWorkflow Services 9.4then selectProperties.
  2. Click the Advanced tab and add the Workflow.SASCodeOperandPrefix property.
  3. Assign the desired value to the new property.
For example, if the Workflow.SASCodeOperandPrefix is defined as wf_, then the following macro variable definition is submitted:
%let wf_category=sales;
If underscores exist in the data object name, then the resulting macro variable name retains each underscore even if an underscore is used as the first character. Thus, _quarterly_sales becomes wf__quarterly_sales. Spaces in data object names are replaced by double underscores. Quarterly Sales becomes _quarterly__sales. The total length of the macro variable name, including the prefix, cannot exceed 32 characters. Longer names are truncated to 32 characters.
The SAS code execution always uses the trusted user identity.
See Policy Usage Examples for a detailed example.
Mapping Data Objects to SAS Macro Variables
To map a data object to a macro variable, follows these steps:
  1. Select a data object.
  2. Select the macro variable that you want to map the data object to.
  3. Click the right arrow button to send the value of the data object to the macro variable, or click the left arrow button to assign the value of the macro variable to the data object.
    SAS Workflow Studio adds a connecting arrow between the data object and the macro variable that it is mapped to.
    For example, the mapping shown in the following figure sends the value of the Total Category data object to the VAR macro variable. The mapping also assigns the value of the RESULT macro variable to the Total data object.
    mapping table showing arrow connecting the total category data object to the VAR macro variable and the result macro variable to the total data object
To delete a mapping, select the arrow connecting the data object and the macro variable, and click the delete button.

Invoke Web Service

The Invoke Web Service policy is used to invoke a web service over SOAP HTTP.
The following properties can be defined for this policy:
Property Name
Description
Web Service Location
Specifies the URL of the web service endpoint. The value can be specified using data object substitution. (See Data Object Substitution.) If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of all of the registered SOAP web services.
Web Service Action
Specifies the SOAP action header value for the web service. The value can be specified using data object substitution.
Web Service Input
Specifies the XML data object used for input. The value can be specified using data object substitution.
The associated schema property should be set from the WSDL for the web service. The value of the data object should contain the body of the SOAP request message.
Web Service Output
Specifies the XML data object used for output.
The associated schema property should be set from the WSDL for the web service. The value of the data object should contain the body of the SOAP response message.
Error Values
Error Code
Specifies the data object (number type) for storage for the code value in the case of an error.
You can click the ellipsis icon to display a list of the existing Number data objects.
Error Message
Specifies the data object (text type) for storage for the message value in the case of an error.
You can click the ellipsis icon to display a list of the existing Text data objects.
Authentication
User Name
Specifies the user name. The value can be specified using data object substitution. If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of registered users.
If a value is specified, then security-level headers are added to the request at both the transport level and the message level.
Note: The user name and password properties are required only if the target service mandates access control.
Password
Specifies the password. The value can be specified using data object substitution.
If this property is specified, then it is used in the security-level headers on the web service request.
Note: The user name and password properties are required only if the target service mandates access control.
Note: This policy requires a single output object for storage of the web service response. If the web service does not define a response, then there is no way to verify that the invocation succeeded. In addition, if a fault occurs, then the response object is not set and the error code and message values are stored in the specified error data objects.
See Policy Usage Examples for a detailed example.

Notify Participant

The Notify Participant policy is used to send a notification via the SAS Alert Notification Service to a participant as defined by their preferences. The notification can be sent when a task starts or finishes.
The following properties can be defined for this policy:
Property Name
Description
Subject
Specifies the subject of the notification.
Message
Specifies the body of the notification.
To create a policy that notifies a participant that a task has started, follow these steps:
  1. Select the target task for the policy definition.
  2. Right-click and select Edit to open the Edit Task dialog box.
  3. Select the Notify participant when task starts check box.
If you expand the task’s Policies folder in the workflow tree, then you should see the Workflow:Notify Participant policy definition. The notification is triggered by the Task Started event that is generated when the associated task starts. When the policy executes, it evaluates the task to see whether the Actual Owner workflow role exists on the current task. If the Actual Owner role is found, then the notification is sent to all users associated with that workflow role. If no Actual Owner workflow role is defined, then the policy execution looks for the Potential Owner workflow role. If the Potential Owner role is found, then the notification is sent to all potential owners. In either case, policy execution obtains the person or group defined for the workflow role. The policy execution then looks up that person or group in the SAS Authorization Service and obtains the relevant notification settings.
To create a policy that notifies a participant that a task has finished, follow these steps:
  1. Select the target task for the policy definition.
  2. Right-click and select Edit to open the Edit Task dialog box.
  3. Select the Notify owner when task finishes check box.
If you expand the task’s Policies folder in the workflow tree, then you should see the Workflow:Notify Owner policy definition. The notification is triggered by the Task Finished event that is generated when the associated task completes. The notification is sent to the owner of the workflow—the person in the Task Initiator workflow role. When a workflow instance starts, SAS Workflow Studio automatically adds the Task Initiator workflow role to the workflow, identifying that person as the original owner (or task initiator).
In addition to the predefined Notify Participant and Notify Owner policies, a workflow designer can create the policy directly and configure the policy using the Edit Policy dialog box. In the Edit Policy dialog box, the designer explicitly specifies the Notify Participant action.
Note: The Send E-mail policy is best suited for testing templates. The Send Workflow Notification and Send Workflow Group Notification policies are recommended for use in production applications because they support flexible configuration options via platform services.

Remove Status from Task

This policy is used to remove a status from the specified task.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path for the target workflow or task.
Status
Specifies the element path for the status that is removed from the target task.

Schedule Task

This policy is used to schedule the initiation of a task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Task to Schedule
Specifies the element path for the scheduled task or subflow.
Schedule Timer Data Object
Specifies the data object containing the expression that defines when the scheduled task or subflow should start. The timer value can be an exact date (Date or String) or a relative expression (String). An exact date must be specified in the following form:
MM/dd/yyyy hh:mm:ss AM|PM
For example, 12/31/2010 11:59:00 PM.
You can use a relative expression to configure the task to start at a moment in time relative to when the policy is triggered. Relative expressions are based on when the parent element starts. You can use the reserved keyword Now, or a plus sign, followed by one or more integers, followed by a unit of measure, as shown in Timer Expressions in the Schedule Task Policy. You can also combine sequences of plus signs, integers, and units of measure, or you can specify a cron expression, as shown in Timer Expression Examples in the Schedule Task Policy.
End Timer Data Object
Specifies the data object containing the expression that defines when the schedule timer should be stopped. This property is optional.
Timer Expressions in the Schedule Task Policy
Unit or Keyword
Description
Example
Explanation
Now
Now
The timer fires immediately.
s
Seconds
+45s
The timer fires in 45 seconds.
m
Minutes
+30m
The timer fires in 30 minutes.
h or H
Hours
+6h
The timer fires in 6 hours.
d
Days
+2d
The timer fires in 2 days.
w
Weeks
+1w
The timer fires in 1 week.
Timer Expression Examples in the Schedule Task Policy
Example
Explanation
+2d+12h+30m
The timer fires in 2 days, 12 hours, and 30 minutes.
0 0 12 * * ?
The timer fires every day at 12 p.m. (noon).

Send E-mail

This policy is used to send e-mail notifications via the SAS Mail Service using the information provided in the policy definition.
The following properties can be defined for this policy:
Property Name
Description
To
Specifies a recipient’s e-mail address.
From
Specifies the sender e-mail address.
Subject
Specifies the subject of the e-mail message. The value can be specified using data object substitution. For more information, see Data Object Substitution.
Message
Specifies the body text of the e-mail message. The value can be specified using data object substitution.
Note: The Send E-mail policy is best suited for testing templates. The Send Workflow Notification and Send Workflow Group Notification policies are recommended for use in production applications because they support flexible configuration options via platform services.

Send Workflow Group Notification

This policy is used to send a workgroup event notification, which triggers the SAS Alert Notification Service to generate end-user notification messages. This policy is used to send notifications to a group or set of recipients and where all recipients are required to be addressed together in a single message. This capability is useful in collaboration scenarios or where the event should be copied to all interested parties. E-mail is the only delivery channel supported using the group notification policy.
The following properties can be defined for this policy:
Property Name
Description
Recipients(s)
Specifies the primary recipients. Separate multiple recipients with commas.
CC Recipient(s)
Specifies the copied recipients. Separate multiple recipients with commas.
BCC Recipient(s)
Specifies the blind-copied recipients. Separate multiple recipients with commas.
Group Recipient(s)
Specifies the primary group recipients. Separate multiple group recipients with commas.
Group CC Recipient(s)
Specifies the copied group recipients. Separate multiple group recipients with commas.
Group BCC Recipient(s)
Specifies the blind-copied group recipients. Separate multiple group recipients with commas.
Description
Specifies the description or e-mail subject for the notification.
Template
Specifies the SAS notification template to use. The default template is the SAS_Email_Message template.
Directive
Specifies the target page to which you are directed upon notification. The value must be a registered SAS directive name. If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of all of the registered directives.
Notification Variables
Specifies one or more element paths for data objects that represent name-value pairs that are used as merge variables for the template. The data object name corresponds to the notification variable name while the data object value is used as the variable value.
Separate the element path values with commas.
HTTP Parameters
Specifies one or more element paths for data object that represent name-value pairs that are used as HTTP parameters. The data object name corresponds to the HTTP parameter name while the data object value is used as the parameter value.
Separate the element path values with commas.
Expiry
Action on Expiry
Specifies the action to perform if the workflow is not completed by the date defined by the Expiration Date Data Object property. The available expiry options are as follows:
None
no expiration action for this notification.
Note: The Expiration Date Data Object property is not required for this option because the notification does not expire.
Remove
removes the policy after the date is passed.
Reroute
sends the notification to alternative recipients or group recipients as specified.
Resend
re-sends the notification to the original recipients defined.
Workflow
starts a new workflow instance using the specified template.
Expiration Date Data Object
Specifies the data object that defines the expiration date of the policy.
Note: This property is available only when the Action on Expiry property is set to a value other than None.
Expiry Recipients(s)
Specifies one or more SAS Platform users to whom notifications are sent when the policy reaches its expiration date.
Separate multiple recipients with commas.
Note: This property is available only when the Action on Expiry property is set to Reroute.
Expiry Group Recipients(s)
Specifies one or more SAS Platform groups to which notifications are sent when the policy reaches its expiration date.
Separate multiple group recipients with commas.
Note: This property is available only when the Action on Expiry property is set to Reroute.
Workflow
Specifies the workflow template to start when the policy reaches its expiration date. If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of activated templates.
Note: This property is available only when the Action on Expiry property is set to Start Workflow.
All policy properties except for Expiration Date Data Object are text fields representing a specific value or a dynamic value using data object substitution. For more information, see Data Object Substitution. The Expiration Date Data Object property is an element path to a data object and does not support data object substitution.
When the Alert Notification Service receives the event, an end-user notification message is generated using the Template Service to specify the message format. Notification variables are name-value pairs that are used as merge variables and are applied to the template. If the Directive property is set, then the Directive Service is used to generate a URL based on the directive name and any value specified for the HTTP Parameters values. The HTTP parameters are optional name-value pairs specified on the event.
Note: Data objects that are used as notification (merge) variables must follow the naming conventions defined for the SAS Template Service.
Note: This notification is directed, and SAS platform users cannot opt out based on preferences.

Send Workflow Notification

This policy is used to send a directed notification via the SAS Alert Notification Service. Workflow notifications can be sent to users via e-mail, SMS message or displayed in a portlet.
The following properties can be defined for this policy:
Property Name
Description
Recipients(s)
Specifies the primary recipients. Separate multiple recipients with commas.
Group Recipient(s)
Specifies the primary group recipients. Separate multiple group recipients with commas.
Description
Specifies the description or e-mail subject for the notification.
Template
Specifies the target notification template to use. The default template is the SAS_Email_Message template.
Directive
Specifies the target page to which you are directed upon notification. The value must be a registered SAS directive name. If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of all of the registered directives.
Notification Variables
Specifies one or more element paths for data objects that represent name-value pairs that are used as merge variables for the template. The data object name corresponds to the notification variable name while the data object value is used as the variable value.
Separate the element path values with commas.
HTTP Parameters
Specifies one or more element paths for data objects that represent name-value pairs that are used as HTTP parameters. The data object name corresponds to the HTTP parameter name while the data object value is used as the parameter value.
Separate the element path values with commas.
Expiry
Action on Expiry
Specifies the option to perform if the workflow is not completed by the date specified by the Expiration Date Data Object property. The available expiry options are as follows:
None
no expiration action for this notification.
Note: The Expiration Date Data Object property is not required for this option because the notification does not expire.
Remove
removes the policy after the date is passed.
Reroute
sends the notification to alternative recipients or group recipients as specified.
Resend
re-sends the notification to the original recipients defined.
Workflow
starts a new workflow instance using the specified template.
Expiration Date Data Object
Specifies the data object that defines the expiration date of the policy.
Note: This property is available only when the Action on Expiry property is set to a value other than None.
Expiry Recipients(s)
Specifies the users to whom notifications are sent when the policy reaches its expiration date. Separate multiple recipients with commas.
Note: This property is available only when the Action on Expiry property is set to Reroute.
Expiry Group Recipients(s)
Specifies the groups to which notifications are sent when the policy reaches its expiration date. Separate multiple group recipients with commas.
Note: This property is available only when the Action on Expiry property is set to Reroute.
Workflow
Specifies the workflow template to start when the policy reaches its expiration date. If you are logged on to the SAS platform, you can click the ellipsis icon to display the list of activated templates.
Note: This property is available only when the Action on Expiry property is set to Start Workflow.
All policy properties except for Expiration Date Data Object are text fields representing a specific value or a dynamic value using data object substitution. For more information, see Data Object Substitution. The Expiration Date Data Object property is an element path to a data object and does not support object substitution.
When the Alert Notification Service receives the event, end-user notification message is generated using the SAS Template Service to specify the message format. Notification variables are name-value pairs that are used as merge variables and are applied to the template. If the Directive property is set, then the Directive Service is used to generate a URL based on the directive name and any value specified in the HTTP Parameters property. The HTTP parameters are optional name-value pairs specified on the event.
Note: Data objects that are used as notification (merge) variables must follow the naming conventions as defined by the SAS Template Service.
Note: This notification is directed and cannot be opted out based on SAS platform user preferences.

Set Multiple Participants

The Set Multiple Participants policy is used to add multiple participants, which specify access control information for the specified (target) task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Workflow
Specifies the element path for the target task or subflow.
Role
Specifies the workflow role to be copied from the source task.
Names Data Object
Specifies the data object that defines the platform identity names of the participants.
Delimiter
Specifies the delimiter to be used if multiple values are specified for the Names Data Object property.
Note: In order for the policy to execute, it must be defined in the same template where the data object is defined.

Set Overdue Status

The Set Overdue Status policy is used to add the Overdue status to a task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path for the target task or subflow.

Set Participant

This policy is used to set a participant, which specifies access control information for the specified (target) task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path for the target task or subflow.
Role
Specifies the workflow role for the participant.
Type
Specifies the platform identity type: User, Group, Role, or Privilege.
Name Data Object
Specifies the data object that defines the platform identity name of the participant.
Note: In order for the policy to execute, it must be defined in the same template where the data object is defined.

Start Workflow

The Start Workflow policy is used to start a task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path for the target task or subflow.

Start Workflow with Label

The Start Workflow with Label policy is used to start a separate (external) workflow instance.
The following properties can be defined for this policy:
Property Name
Description
New Workflow Label Data Object
Specifies the element path to a data object that contains the name of the workflow template to start.
New Workflow ID Data Object
Specifies the element path to a data object that holds the instance ID of the created workflow instance. This data object must exist in the current (parent) instance.
Current Workflow ID Data Object
Specifies the element path to a data object that contains the instance ID of the parent task executing this policy. This data object must exist in the newly created child instance.
When the policy executes, the workflow instance is started. The instance ID of the newly started (child) instance is stored in the New Workflow ID data object of the existing instance (parent). In addition, the policy execution looks for the Current Workflow ID data object in the child instance and stores the instance ID of the parent task associated with the policy.

Stop Workflow

The Stop Workflow policy is used to stop a task or subflow.
The following properties can be defined for this policy:
Property Name
Description
Task
Specifies the element path for the target task or subflow.

Stop Workflow with ID

The Stop Workflow with ID policy is used to stop an external workflow instance as defined by the identifier that is stored in a data object.
The following properties can be defined for this policy:
Property Name
Description
Workflow ID Data Object
Specifies the element path to a data object with the ID value of the target instance.

Submit a JES Job

The Submit a JES Job policy enables you to execute code that has been registered with the SAS Job Execution Service and resides on the server. A single job can execute a single task or multiple tasks bundled together. The job is executed via SAS Job Execution Service. For more information, see SAS Intelligence Platform: Middle-Tier Administration Guide.
The following properties can be defined for this policy:
Property Name
Description
Job Name
Specifies the name of the JES job. You must be logged on to the SAS platform to select a Job Name. Click the ellipsis icon to display the list of all of the registered JES jobs.
Error Code
Specifies the data object (Short text type) for storage for the code value in the case of an error.
If you are logged on to the SAS platform, you can click the ellipsis icon to display a list of the existing Short text data objects.
Error Message
Specifies the data object (text type) for storage for the message value in the case of an error.
If you are logged on to the SAS platform, you can click the ellipsis icon to display a list of the existing Text data objects.
After you have selected the Job Name, SAS Workflow Studio displays the list of tasks with Input and Output fields for each task. You can then map data objects to parameters and results for each of these tasks.
Last updated: March 5, 2020