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- See How To: Link a SharePoint application's workflow to a secondary list or library for an example of using a System > SharePoint 2013 Integration > SharePoint Integration Setting SmartObject in a workflow to link a secondary list or library to a primary list or library.
- See How To: Use a workflow as an intermediary to upload a file from a form to cloud storage for an example of using a Google Drive File SmartObject 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.
- 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 Workflow 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 Workflow API.
- See the How To: Configure and use the "Wait for External System" option in a workflow for more information on how to configure the Wait for external system.
- 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. Dragging a the SmartObject Method from the Basic category, you need to select the SmartObject from the drop-down menu. |
Click the menu and select Browse to browse to the SmartObject. |
Method |
In this section, select the method for the SmartObject. Click the menu and select the required method. The methods available for each SmartObject depends on the methods created while designing the SmartObject. |
Click the menu to select the applicable method from the list. |
Identifier |
Use this to specify an identifier. When you select a SmartObject the workflow designer shows available methods in the Method field. Some methods, such as the Get List method, gives you the option to select an identifier to identify unique records for reference purposes.For information on using references, see Using References. |
Click the menu and select the applicable identifier from the list. |
Filters |
The filter allows you to specify parameters and filters to return data. Applying filters is optional. Use operators such as Equal, Not Equal, Starts With, Ends With, and Contains. Parameters are sometimes required - it depends on the SmartObject method selected. If the method has parameters, you probably need to provide values for those parameters to execute the 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 Add 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 variables. 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 Add to show 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 Add 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 Trash bin. |
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 Variables |
The Output mappings 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 Variable, XML field or another SmartObject property. By default, this option is selected. |
Select the radio button to enable this option. Click Add to add Variable Properties. Click Add 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 Add 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 Trash bin. |
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 records you want to return from the selected method. Example: If a List method 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 menu, select what data to return. Check the Ordered By check box to enable this function. From the 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?
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) See the following resources for more information:
|
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/Name field. |
Reset link | Use the link to reset any changes to the title. | Click the Reset link to reset the Title/Name 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 Create Newfield. |
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 |
If an error occurs when the step executes at runtime, this configuration specifies whether to continue to the next step in the workflow, or not. |
Check the check box to continue the workflow even if an error occurs in the step. Uncheck the check box to stop workflow execution if an error occurs. In this case, the workflow will go into an Error state and an administrator will need to Retry the error before the workflow will resume. |
In K2 Five (5.3) Fix Pack 38 and later an additional exception configuration is available: a check box stating Force error when required SmartObject inputs are missing. When executing a SmartObject step in a workflow, if the SmartObject's required input fields don't have values, this option specifies whether to continue on to the next step in the workflow, or not.
If the error is forced, the workflow instance stops and the following error shows in K2 Management > Workflow Server > Workflows > {workflow name} > Errors tab: "One or more required inputs are missing for the {SmartObject Method} method in the {StepName} step."
Checking this check box overwrites the Continue on error functionality.
By default, this check box is checked for all new workflows. For existing workflows, this check box is unchecked.
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 menu.
- If the Wait for external system option is not available, it could be that you created the SmartObject step before the functionality was available. To enable the Wait for external system option you need to remove this SmartObject step from the canvas and add and configure it again.