How to check which SmartObjects belong to specific service instance?
kbt165572
PRODUCTObjective
Consider the following scenario: during Package and Deployment, you created a duplicate Service Instance (by mistake) which has a display name identical to another existing service instance (e.g. you created an additional Endpoint Assembly service instance which points to exactly the same DLL file as an existing service instance with the same display name).
In this scenario it is necessary to delete the duplicate service instance and be sure you are deleting the right one (i.e. no existing/used SmartObjects will be impacted by its removal). To be able to do that you need to check which SmartObjects belong to which specific service instance.
Before You Begin
How-to Steps
There are two ways to check which SmartObject belongs to which specific service instance:
1. Use the Tester Tool > Tools > Search SmartObjects > Service.
2. Or by using the SQL script which has to be run against the K2 database:
FROM [SmartBroker].[SmartObject]
CROSS APPLY SmartObjectXML.nodes('/smartobjectroot/methods/method/serviceinstances/serviceinstance[1]') AS SO(ID)
WHERE SO.ID.value('@guid', 'nvarchar(100)') = '%INSERT_SI_GUID%'
ORDER BY SMOSystemName
Once you've identified the "unnecessary" service instance (the one which does not have SmartObjects linked to it), you can delete it using the Tester Tool utility.