Advanced Authoring Concepts
Cisco Process Orchestrator provides integrations with various technologies. Although it supports numerous types of integrations, at the core Process Orchestrator provides the individual steps that make up the workflows in processes; these are called
activities
. For example, Process Orchestrator provides:
-
A set of String activities that you can use to manipulate string text and characters.
-
A set of Table activities that you can use to modify the format for existing defined table variables. The available table variables can be defined as either a global or process variable.
-
A Set Variable activity that you can use to place a collection of bits in a Process Orchestrator number.
-
Knowledge base articles provide information to help understand the results of an activity, including a summary of what has occurred, the possible cause of the result, and suggested actions to take to resolve issues with an activity.
Note that:
-
Modifying a process does not automatically modify an activity. Activity definitions are included in a process workflow and the activity properties must be modified separately from the process properties.
-
Activities can only be modified in the Process Editor. With the appropriate rights from the Operations view, the Process Editor is launched when accessing the process properties.
-
When user rights are restricted, the Process Viewer is launched with the properties displaying a display-only view after determining that the user cannot edit the activity.
The following topics describe these activities:
Related Topics
For instructions about inserting a variable in an activity, see Inserting Reference Variables.
Using Table Activities
You can use Table activities to modify the format for existing defined table variables.
Note Any boolean and numeric values that are used by the Table activities in the product are not localized. Numbers use [ . ] for the decimal format regardless of the regional and language options. Boolean values for substitutable boolean must be true or false regardless of the installed language.
For example, you can:
Table 7-1 Sample Table Activities
|
|
Add Row to Table
|
Append new rows to a table variable. The row is added to the end of the table.
This activity will not work on tables that are outputs of other activities.
|
Analyze Table
|
Summarize and analyze data in a table variable or property using basic aggregation functions.
|
Highlight Row
|
Highlight selected rows of a table variable. Highlighted rows can only be displayed in an automation summary. Therefore you will not see the highlighted rows in Process Orchestrator unless you are viewing the automation summary.
|
Remove Row from Table
|
Remove one or more rows from a table variable based on specified criteria.
This activity will not work on tables that are outputs of other activities.
|
Select From Table
|
Query and select rows from a source table using specified criteria. The user can also determine the order of the rows selected as well as limit the number of rows displayed.
|
Set Table Variable
|
Modify the value of a defined table variable. You must specify a name for the activity, choose the defined variable that you want to modify, and enter a new value for the table variable using a different table variable property.
The table variables used must match in their entirety, including the name of columns, number of columns, and the type of columns or the activity will fail.
|
Update Row in Table
|
Update the selected rows of a table variable. The new rows become part of the variable being modified. You will not see the modified rows in the automation summary, but you can see the rows in the variable property pages in Process Orchestrator.
This activity will not work on tables that are outputs of other activities.
|
Read Table from Text
Read a comma-separated value (CSV) string variable and convert the text into a table with a specified set of columns.
Populate columns from first record in source text—Check this check box to use the first row data from the source text as table columns in the output result.
By enabling this check box, the Columns to read field is hidden.
When you enable this check box for existing activities with data in Columns to read field. All existing data in columns in read is deleted.
File type—The source text can be delimited by Tab, Semicolon, Comma, Space, and Other (enter the required delimiter).
For example, if the Populate columns from first record in source text is checked & File type is delimited by Comma:
Source text:
City,County,State
"Georgetown","Williamson","TX"
Georgetown,Williamson,TX
\"Georgetown\",\"Williamson\",\"TX\"
Georgetown,Taylor,LibertyHill,Williamson,TX
"Georgetown,Taylor,LibertyHill",Williamson,TX
|
|
|
Georgetown
|
Williamson
|
TX
|
Georgetown
|
Williamson
|
TX
|
“Georgetown”
|
“Williamson”
|
“TX”
|
Georgetown
|
Taylor
|
LibertyHill
|
Georgetown,Taylor,LibertyHill
|
Williamson
|
TX
|
The following example explains how you can include multiple strings in a single column using double quotes (Last row) and you can use slash (\) to include double quotes along with the string (Third row).
The fourth row displays only the first three strings being considered as City, County, and State as we have three columns only.
Read Table from XML
Read an XML snippet and convert it into a table with a specified set of columns.
Populate columns from xml—Check this check box to use xml elements from the source xml as table columns in the output result.
By enabling this check box, the Columns to read field is hidden.
When you enable this check box for existing activities with data in Columns to read field. All existing data in columns in read is deleted.
For example:
Row XML Element Name:
Columns to read:
Source XML:
This produces a table with two columns (name, age), with three rows.
Read Table from JSON
Read an JSON and convert it into a table with a specified set of columns.
JSON Path: Enter the JSON path to be used as columns.
Populate columns from JSON—Check this check box to use JSON elements from the source JSON as table columns in the output result.
By enabling this check box, the Columns to read field is hidden.
When you enable this check box for existing activities with data in Columns to read field. All existing data in columns in read is deleted. For example:
JSON Path:
Source JSON:
“title”:”Sayings of the century”, “title”:”Sword of Honour”, “author”:”Herman Melville”, “author”:”J.R.R. Tolkien”, “title”:”The Lord of the Rings”,
This produces a table with author as column name, with four rows containing author names. For example:
Join Tables
Join two tables with same schema’s or with different schema’s such as table from text, table from xml etc. and convert it into a table with a specified set of columns.
-
Table1—Select table 1 by clicking the reference tool.
-
Table2—Select table 2 by clicking the reference tool.
-
Join Type—Select type of join from the drop–down list:
– Inner—Displays all records that match the condition in both the tables, and records in both the tables that do not match are not reported.
– Left Outer—Displays all the rows from the left table in conjunction with the matching rows from the right table. If there are no columns matching in the right table, it returns NULL values.
– Right Outer—Displays all the rows from the right table in conjunction with the matching rows from the left table. If there are no columns matching in the left table, it returns NULL values.
– Union—Displays matched and unmatched from both tables.
-
On Condition—Select on condition for the table 1 and table 2 columns either by clicking the reference tool icon or by entering the column name manually in case of table from XML.
Note This mandatory field will be read only, if the selected join type is Union.
-
Results Column—You can Select All or Unselect All or select the columns from the results column as needed.
-
Number of rows—Click All rows or At most radio button by entering the appropriate number of rows.
This produces a table with two tables combined by selected join type and on condition entered for table1 and table 2 column.
Using Core Activities
Core activities are a set of items that span applications. For example, use the following activities to:
Table 7-2 Sample Core Activities
|
|
Calculate Date
|
Calculate a new date/time value based on a specified base date/time and adjustments.
|
Format Date
|
Convert the date and time into a string text format. For example:
Format string
yyyyMMdd hh:mm:ss tt
Original Date/Time
10/23/2009 10:23:00 PM
Result
20091023 10:23:00 PM
|
Correlate Process Event
|
Check whether a process event occurred within a certain amount of time of another problem (see Creating Correlate Event Activities).
|
Create Automation Summary
|
Generate an automation summary including data selected activities in a process. To generate the data output, choose the activity, then specify the section in the automation summary in which to output the data.
An automation summary is a collection of data summarizing the objects included in the process and the data retrieved by the processing of the of the objects.
The share path specified in the Core Functions Adapter properties will be used when viewing the automation summary reports.
|
Find Targets
|
Among other use cases supported by this activity, you can find targets whose properties have certain values.
|
Insert Event
|
Define the configuration properties to be used to insert one event into Process Orchestrator Reporting Database.
|
Publish Metric
|
Define the performance metric properties to be published into the Process Orchestrator Reporting Database and the Windows Management Instrumentation (WMI) provider.
The metrics are published under the
root\TEO
name space through the WMI class,
TEO_PerformanceMetric
.
|
XPath Query
|
XPath queries navigate through XML documents and search through the document nodes. Use the XPath Query dialog box to enter the XPath properties to query from the source XML code.
For additional information, see:
|
XSL Transform
|
Apply an XSLT transformation to a specific XML text. XSLT transformation can transform XML into plain text, HTML, or other XML.
|
Adding an XPath Namespace Definition
An XML namespace provides a way to avoid element and attribute name conflicts within an XML document. An XML namespace is uniquely identified by a Uniform Resource Identifier (URI) and is assigned a prefix (unique to the XML document) used for its element and attribute names.
To add an XPath namespace:
Step 1 In the Process Editor, choose
Toolbox > Core Activities > XPath Query
, then drag and drop the activity onto the Workflow pane.
Step 2 Choose the
XPath Query
tab, then choose
Namespaces > New
.
Step 3 In the XPath Namespace Definition dialog, enter the prefix and URI for the new namespace, then click
OK
.
XPath Example Syntax
The following expressions can be used when selecting nodes in a path expression.
|
|
nodename
|
Selects all child nodes of the named node
|
/
|
Selects from the root node
|
//
|
Selects nodes in the document from the current node that match the selection no matter where they are
|
.
|
Selects the current node
|
..
|
Selects the parent of the current node
|
@
|
Selects attributes
|
XPath Query Example
The following is an example of source XML.
|
<?xml version=”1.0” encoding=”ISO-8859-1”?>
<title lang=”eng”>Harry Potter</title>
<title lang=”eng”>Learning XML</title>
|
The following example path expressions and related results are based on the preceding source XML.
|
|
bookstore
|
Selects all child nodes of the bookstore element
|
/bookstore
|
Selects the root element bookstore
Note If the path starts with a slash ( / ) it always represents an absolute path to an element.
|
bookstore/book
|
Selects all book elements that are children of bookstore
|
//book
|
Selects all book elements no matter where they are in the document
|
bookstore//book
|
Selects all book elements that are descendant of the bookstore element, no matter where they are under the bookstore element
|
//@lang
|
Selects all attributes that are named lang
|
For additional examples, see
http://www.w3schools.com/xpath/xpath_syntax.asp
.
XPath Query Example 2
In the following example, the elements prefixed with xdc are associated with a namespace whose name is
http://www.xml.com/books
, while those prefixed with h are associated with a namespace whose name is
http://msdn.microsoft.com/en-us/library/ms950779.aspx
.
|
<h:html xmlns:xdc=”http://www.xml.com/books”
xmlns:h=”http://www.w3.org/HTML/1998/html4”>
<h:head><h:title>Book Review</h:title></h:head>
<xdc:title>XML: A Primer</xdc:title>
<h:td>Author</h:td><h:td>Price</h:td>
<h:td>Pages</h:td><h:td>Date</h:td></h:tr>
<h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
<h:td><xdc:price>31.98</xdc:price></h:td>
<h:td><xdc:pages>352</xdc:pages></h:td>
<h:td><xdc:date>1998/01</xdc:date></h:td>
|
For additional examples, see
http://msdn.microsoft.com/en-us/library/ms950779.aspx
.
Authoring Knowledge Base Articles
Knowledge base articles provide information to help understand the results of an activity, including a summary of what has occurred, the possible cause of the result, and suggested actions to take to resolve issues with an activity. Knowledge base articles can make automation summaries more usable, explaining how to use the information that is surfaced.
Knowledge base articles are referenced by specific activities and can be viewed in the following locations in Process Orchestrator:
-
Operations Workspace—When viewing activity instance properties, you can view the display-only properties of the associated knowledge base articles by selecting the Knowledge Base tab.
-
Process Editor—You can reference a knowledge base article to an activity when defining the activity properties in the Process Editor.
-
Automation Summary—All referenced knowledge base articles will display on the automation summary.
The Definitions > Knowledge Base view displays the available knowledge base articles that can be assigned to a process activity or to a trigger. When Knowledge Base Articles is selected in the Navigation pane, the defined knowledge base articles display in the Results pane.
Process Orchestrator ships with predefined knowledge base articles, or you can create your own knowledge base articles to associate with activities in the process.
To create a knowledge base article:
Step 1 Choose
Definitions > Knowledge Base
, right-click and choose
New > Knowledge Base
.
Step 2 On the
Knowledge Base
property pages, define the properties, including:
-
Summary—A concise description of the issue.
-
Possible cause—An explanation of the condition that may be causing the issue. If necessary, enter multiple possible causes so that all possibilities are investigated.
-
Possible resolution—List of actions that can be performed to attempt to resolve the issue.
-
Related information—Additional information that may be relevant to the issue.
Step 3 Click
OK
to close the dialog box.