SmartObjects Overview
The SmartObjects category in the Toolbox contains Standard SmartObjects and custom SmartObjects. Use SmartObject to apply the available SmartObject methods within a workflow. These SmartObjects are dragged onto the canvas, configured and then forms part of the workflow.
The SmartObjects category is made up out of sub-categories, which in turn contains related SmartObjects to drag onto the canvas, and use in your workflows. Drag the SmartObject step from the category, Favorites bar, or the Recent category onto the canvas.
Example of a SmartObject step in a workflow
In general, most of the SmartObject steps configuration set up follows the same process. The SmartObject step is dragged from the category, Favorites bar and the Recent category onto the canvas.
- From the category, drag the SmartObject 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 SmartObject tab. Use this tab to configure the SmartObject's properties.
- Create - Creates a record instance in the K2 SmartObject.
- Save - Saves the record instance in the K2 SmartObject.
- Delete - Deletes the record instance from the K2 SmartObject.
- Load - Loads a record from the K2 SmartObject.
- Get List
- The SmartObject step executes and your workflow goes in to an active state while it waits for the external event to complete.
- A context browser field populates with the Worflow Step Serial Number for the current activity. This serial number is used to resume your workflow as soon as the external event completes.
- You can resume the workflow as part of your SmartObject call. This is done manually with the Worflow API.
- With the SmartObject step selected click on the Properties tab.
- Click the Errors tab.
-
Your changes are automatically saved.
For more information on how to use the error console, see the Error Console topic.
The following table explains the options available on this tab:
Option | Explanation | How to Use |
---|---|---|
SmartObject |
Use this to select the SmartObject. By default, the SmartObject populates the field when you drag it from the SmartObject category onto the canvas. Note: Dragging a the SmartObject Method from the Basic category, you need to select the SmartObject from the drop-down menu. |
Click the drop down menu and select Browse to browse to the SmartObject. |
Method |
In this section, select the method for the SmartObject. Click the drop down and select the required method. The methods available for each SmartObject depends on the methods created while designing the SmartObject. Available methods are: |
Click the drop down menu to select the applicable method from the list. |
Identifier |
Use this to specify a identifier. When determining the key property for the SmartObject, the workflow designer shows available methods. It checks for a default load method and, if a method is found, uses the ID property. If a default Load method is not found, it checks for the default list method. If that is found, it uses the key property. If not found, all available properties are returned for you to select one to use. Use the identifier to identify a unique record for item reference purposes. This applies to list references you create for a SmartObject. When you use fields from the reference and you don't specify an identifier, all records for that reference are returned as a concatenated list, which is typically not the desired behavior. |
Click the drop down menu and select the applicable Identifier from the list. |
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. |
Input Mappings |
The Input mapping section maps SmartObject input fields to data fields. Both input properties and parameters can be required or optional. When you drag a SmartObject onto the canvas and select the method, only required properties show in the Input Mappings section. A lock icon indicates these required properties. You can add additional properties of the SmartObject by clicking the add button and selecting them from the input mapping list as shown here.
|
Add data into the required properties. Click on the Add button to display a list of available fields / parameters to add and configure.
In the 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 remove an added property, select the property and click the Trash Bin button. |
Output Mappings | ||
Create Reference |
Use this feature to create a reference to the SmartObject to use from other steps within the workflow. You can create a reference to a SmartObject using the Create Reference step, but it s recommended to rather create the reference using this option. |
Select the radio button to enable this option. Click the Create link to create a reference. Click the Edit link to edit the reference name. If you edited the reference name and want to reset it, click the Reset Name link. |
Map to Data Fields |
The Output mapping for the SmartObject are listed in this section. These mappings are used to store any return values from the SmartObject method. The return property can be mapped to a Data field, XML field or another SmartObject property. By default, this option is selected. |
Select the radio button to enable this option. Click the Add button to add Data Field Properties. Click on the Add button to display a list of available fields / parameters to add and configure. 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 remove an added property, select the property and click the Trash Bin button. |
Do not map outputs |
No output mappings will be set. |
Select the radio button to enable this option. Select this option if no output mapping is required |
List Options |
Use this to specify what you want to return from the selected method. Example: If a List methods is selected you can select between All, First, Last and Index. The returned data can be ordered by a selected property within the SmartObject and sorted either ascending or descending |
Click the down arrow to expand this section. From the drop down menu, select what data to return. Check the Ordered By check box to enable this function. From the drop down menu, select the property to order by. Click the Ascending or Descending radio button to select order. |
Options | ||
Wait for external system |
The Wait for external system option is used when you integrate your workflow with an external system, using a SmartObject. This might take some time and your workflow step needs to wait till the external event completes. Only then can the workflow step complete and move on to the next step. What happens at runtime when the check box is checked? Note: Use the Workflow Step Serial Number field as an input on your current executing SmartObject. This ensures that you get the correct serial number to resume your workflow with. Example of the serial number 1_14 (Where 1 is your ProcInstanceId and 14 is your ActiviyInstanceId) |
Check the check box to enable this function |
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. |
- SmartObjects steps will only be available in the SmartObjects category once it has been selected to be used in workflows in the SmartObject Designer. In order to make this SmartObject available in the K2 Workflow Designer, edit the SmartObject and select to "Allow this SmartObject to be used in Workflows" on the Details screen of the SmartObject Designer
- A SmartObject step can only be used to execute a single method. Multiple methods are not support within the same step.
- Only SmartObjects you have access rights to will appear in the Toolbox
- Dragging a the SmartObject Method from the Basic category, you need to select the SmartObject from the drop-down menu.