Deleting and renaming SmartObjects and SmartObject properties
When you build a workflow and use SmartObjects in your workflow (such as using references and mapping configuration values to SmartObject properties), the workflow has dependencies on the targeted SmartObject. Your workflow will not deploy successfully if the SmartObject dependencies are missing or not configured. Consider this example: You drag a Send Email step onto the canvas, and use values from a Customer.GetList SmartObject method to populate the email body with values from the SmartObject. The workflow now has a dependency on the Customer SmartObject. If you delete a property from the Customer SmartObject and that property was used in the Send Email step, you workflow will not deploy, since there is now an invalid property mapping in the Send Email step.
To help you identity dependency issues, the workflow designer has a built in Error Console that checks these dependencies as you build your workflow. The error console checks if your configurations are correct. If not, a visual indicator (red exclamation mark or red dot) shows. Open the error console to see a detailed description of the error and use the Show Me... link to navigate to the step where the error exists.
If a SmartObject, SmartObject property or SmartObject method is deleted, renamed or changed, it could affect workflows that depend on that SmartObject. Before you delete or change a SmartObject, research the impact of these changes since the changes could negatively affect workflows that use that SmartObject,. The Error Console is one of the tools you can use to determine breaking changes if you have deleted or changed a SmartObject.
Let's look at a few scenarios for deleting and renaming SmartObjects or SmartObject properties in your workflow.
This example shows what happens to the workflow step when you delete a SmartObject from the K2 Designer.
You create a SmartObject called Customer Details to capture details such as Name, Company, Industry Type, Region, Sales Rep, Account No and Status. As part of your workflow a user receives a task to confirm customer details. If the details are incorrect a rework email is sent. You configure the subject and email body of the Rework Required with applicable properties from the Customer Details SmartObject.
In this example, locate the Customer Details SmartObject from the K2 Designer and delete it.
From K2 Designer, locate the workflow and click Edit. Select the Rework Required step. Notice the red indicators on step and configuration level. This indicates that the items are missing some configuration.
For more information on the indicators see Error Console and Indicators.
Click on the red error indicator located at the bottom right of the canvas. It shows the number of errors.
The error console opens. In here you find a description of the errors and on which step they occur. In this example, the Rework Required step contains references to the removed Customer Details SmartObject.
Note that you cannot deploy this workflow until you've resolved the error messages.
To resolve this, you need to recreate the SmartObject and its properties. It is important to use the same (exact matches) SmartObject name, property names and SmartObject methods used in the deleted/missing SmartObject.
From the K2 Designer, select the workflow and click Edit. The workflow loads and re-evaluates the configured SmartObject and SmartObject mappings.
Select the Rework Required step. Notice the red indicators no longer show.
This example shows what happens to the workflow step when you delete a SmartObject property from the SmartObject using the K2 Designer.
You create a SmartObject called Customer Details to capture details such as Name, Company, Industry Type, Region, Sales Rep, Account No and Status. As part of your workflow a user receives a task to confirm customer details. If the details are incorrect a rework email is sent. You configure the subject and email body of the Rework Required with applicable properties from the Customer Details SmartObject.
In this example, locate the Customer Details SmartObject from the K2 Designer and Edit it.
Delete a property from the Customer Details SmartObject. In this example, select Company and click Remove. Click Finish.
From K2 Designer, locate the workflow and click Edit. Select the Rework Required step. Notice the red indicators on step and configuration level. This indicates that the items are missing some configuration.
Click on the red error indicator located at the bottom right of the canvas. It shows the number of errors.
The error console opens. In here you find a description of the errors and on which step they occur. In this example, the Rework Required step contains a reference to the missing Company SmartObject property.
Note that you cannot deploy this workflow until you've resolved the error messages.
To resolve this, you need to recreate the missing SmartObject property. In this example, edit the Customer Details SmartObject and Add the Company SmartObject. Click OK and Finish.
From the K2 Designer, select the workflow and click Edit.
Select the Rework Required step. Notice the red indicators no longer show.
This example shows what happens to the workflow step when you rename SmartObject from the K2 Designer.
You create a SmartObject called Customer Details to capture details such as Name, Company, Industry Type, Region, Sales Rep, Account No and Status. As part of your workflow a user receives a task to confirm customer details. If the details are incorrect a rework email is sent. You configure the subject and email body of the Rework Required with applicable properties from the Customer Details SmartObject.
In this example, locate the Customer Details SmartObject from the K2 Designer. Right click and select Rename.
Change the SmartObject name to Prospect Customer Details and click OK.
From K2 Designer, locate the workflow and click Edit. Select the Rework Required step. Notice the SmartObject name change from Customer Details to Prospect Customer Details.
This example shows what happens to the workflow step when you rename a SmartObject property from the SmartObject using the K2 Designer.
You create a SmartObject called Customer Details to capture details such as Name, Company, Industry Type, Region, Sales Rep, Account No and Status. As part of your workflow a user receives a task to confirm customer details. If the details are incorrect a rework email is sent. You configure the subject and email body of the Rework Required with applicable properties from the Customer Details SmartObject.
In this example, locate the Customer Details SmartObject from the K2 Designer and Edit it.
Edit a property from the Customer Details SmartObject. In this example, select Region and click Edit.
Change the property name to Sales Region, click OK and Finish.
From K2 Designer, locate the workflow and click Edit. Select the Rework Required step. Notice the property name change from Region to Sales Region.