Create Reference Step
Use the Create Reference step to generate dynamic item references to a SmartObject item. You can use this for various line of business systems for which you have SmartObjects created. An item reference is an XML structure that contains information about loading records from a SmartObject. The Create Reference step binds the SmartObject data to the workflow, making it easier to reuse the SmartObject reference and properties of the SmartObject throughout your workflow.
Use the Create Reference step to:
- Eliminate the need to create data fields to track SmartObjects used in the workflow
- Make a single SmartObject call to create the reference instead of setting up filters and parameters each time you need to use a SmartObject property
- Use properties of the reference throughout your workflow activities and events
Drag the Create Reference step from the Basic category, Favorites bar, or the Recent category onto the canvas.
Example of a Create Reference step in a workflow
- From the Toolbox click the Basic category, then drag the Create Reference step onto the canvas.
- Select the added step and click the expand / collapse toggle to expand the Configuration Panel. You can also double click the step to expand the panel.
- Select the Create Reference tab. Use this tab to configure the reference to a SmartObject or SmartObject method.
- Select a SmartObject from the recently picked drop down list or browse to one.
This is a required field.
- Select Browse and find the SmartObject containing the record or records you need to reference.
- Select a method of the SmartObject from the drop down.
- In this example, the List method is selected which, when selected, shows the Identifier field.
- Click the Add Filter link to specify parameters or filters to return data dynamically.
Filtering is dependent on the service object. Some service objects have filter functionality built in as part of the query issued by the broker. For those service objects that don't, the filter is applied after data is returned to the SmartObject. In the latter case, the number of records that are handled by K2 (versus the LOB system) could cause workflow performance issues.
Applying filters is optional. Parameters depend on the SmartObject method and are sometimes required. The filter may have a positive impact on performance by limiting the number of records returned. When you create a filter, only records that match the filter criteria are returned.
- Select a property from the drop down menu. Select an operator to define the filter. Type values or create dynamic values by dragging Functions, Fields, SmartObjects and Workflow-related items from the Context Browser into the fields.
- In the Filters section, click the Add button to add a property.
- In the Properties section click the drop down menu to select and configure a value.
In the added property field, type a value, use inline functions, or dynamic fields, by clicking on the Add button to expand the Context Browser. Within the Context Browser, select inline functions and fields from the Functions, Fields, SmartObjects and Workflow categories. Click and drag the function into the property field.
- To add additional properties to filter by, click the Add button.
- To delete properties, select one and click the Trash Bin.
- To create a reference click Create. Reuse this reference in the current step or from another step in your workflow.
- To edit the auto-generated reference title, click Edit and change it.
- To locate the added reference expand the Context Browser, select Fields and expand the Reference section.
- Click the List Options down arrow to configure what data is returned and if you want it sorted.
- All - Returns all records
- First - Returns the first record
- Last - Returns the last record
- Index - Specify index
- With the step selected, select the Properties tab.
- Click the Errors tab.
Your changes are automatically saved.
The following table explains the available options:
Option | Explanation | How to Use |
---|---|---|
SmartObject and Method | ||
Select SmartObject |
Contains a list of recently used SmartObjects and a Browse button to locate more. |
Select the SmartObject from the drop down menu. |
Select Method | Contains a list of methods of the SmartObject. | Select the method from the drop down menu. |
Identifier |
Once you select a method, the Identifier is populated. The Identifier only displays when the SmartObject does not contain a key property and requires you to select one. |
Select the identifier from the drop down menu. |
Filters |
The filter enables you to specify parameters and filters to return data. Use operators such as Equal, Not Equal, Starts With, Ends With, and Contains. Applying filters is optional. Parameters are sometimes required and depend on the SmartObject method. |
Click the Add Filter link to add filters. Select filter values from the drop-down menu. Click the operator button to select the operator. Click the Add button to add additional filter properties Type values or create dynamic values by dragging Functions, Fields, SmartObjects and Workflow-related items from the Context Browser into the fields. To delete properties, select them and click the Trash bin. |
Properties | Specify additional properties for the returned results. |
Click the add button to add additional property fields. Select the property from the drop down menu. Type values or create dynamic values by dragging Functions, Fields, SmartObjects and Workflow-related items from the Context Browser into the fields. To delete properties, select them and click the Trash bin. |
Fill Reference | This option enables you to create a reference to refer to, and use it in any part of your workflow. |
To create a reference click Create. Reuse this reference or add it to any other part within your workflow. |
For more information about the different browse states and errors, see the Browse State topic.
For more information on how to use the breadcrumb bar, see the How to use the Breadcrumb topic.
For more information on how to use Smartfields see the Smartfield Composer topic. Added filters can be grouped together to form parameters. To group parameters, click the AND button.
The following table explains the available options:
Option | Explanation | How to Use |
---|---|---|
List Options | Specify what data to return from the list. You can select one of the following: | Select the option from the drop down menu. |
Ordered By | Use this to specify a field on which the returned data is sorted. You can select the display order as ascending or descending. | Check the Ordered By check box to enable this option. Select the field to order on, from the drop down menu. Select either the Ascending or Descending radio button. |
The following table explains the options available on this tab:
Option | Explanation | How to Use |
---|---|---|
Title / Name | By default, each step on the canvas has a step title. You can change this title to suit your workflow logic and show it on the canvas by checking the Show Label box. | Enter a value into the Title field. |
Reset link | Use the link to reset any changes to the title. | Click the Reset link to reset the Title field to default value. |
Show Label | Allows you to see the step label on the canvas. The label shows the value of the title. | Check the check box to display step label on the canvas. |
Description | Allows you to add a detailed description for the step. | Enter a value into the Description field. |
Notes | Allows you to add additional notes for the step. | Enter a value into the Notes field. |
Different types of exceptions can occur on a step, such as:
Type | Description |
---|---|
Known exceptions | Any SmartWizard or standard wizard that has Boolean options for handling known exceptions have these options displayed as check boxes in the Known exceptions section of the Exceptions tab. |
Unhandled exceptions | Any unknown runtime exceptions. |
The tab contains the following known exceptions:
Exception | Explanation | How to Use |
---|---|---|
Continue on error | On step execution and an error occurs, continue to the next step in the workflow. | Check the box to continue if an error occurs. Uncheck the check box to stop workflow execution if an error occurs. |
The tab contains the following unhandled exception:
Exception | Explanation | How to Use |
---|---|---|
Log Exception | Logs the exception to the error log. | Check the box to log the exception. |
When working with the Create Reference step keep in mind the following considerations:
- The filter feature positively affects reporting query performance as all records are not returned. If a filter has been applied, records are filtered according to the filter criteria and only those records that match the filter are returned, as long as the service object (and LOB) supports server-side filtering
- When using the filter feature, using input mappings is critical if a large number of records exist on the LOB system. The more records you can filter-out before the results are returned to K2, the better the performance is. If items are filtered out of the result set that is expected by using parameters, the filters applied may not work properly. As a troubleshooting tip, supply parameters only, look at the result set to confirm the records, and then go back and apply one or more filters