+44(0)1908738254
YOUR EXPERT RPA PARTNER

Team up with our RPA strategy and tech specialists for maximum automation impact

Find out more
Harness the power of UiPath in your business.
WATCH NOW

Save money and spend more time on priority work.

Book consultation
READY, SET, AUTOMATE

Let's choose, design and deploy a process automation solution for your business.

Find out more
TRANSFORM YOUR BUSINESS

Let's analyse your business to discover opportunities for innovation and automation.

Find out more

Begin your business transformation journey

Book consultation
AUTOMATE EVERY FUNCTION

Automate where it matters most. Scale to solve challenges in every area

Find out more
GIVE EVERY TEAM THE TOOLS FOR SUCCESS

Equip people with user-friendly solutions that save time and make work easier

Find out more

Which business problem
can we solve first?

Book consultation
04 May 2015

Debugging, Refreshing, Re-adding K2 Service Instances and K2 Service Types through the K2 SmartObjects Tester

It has often happened that I make changes to my K2 Service Object, but then these changes do not reflect when I execute the Service Method through my K2 SmartForms.

When these type of scenarios happen your first point of call is usually the K2 SmartObject Tester.

K2 Automated Testing Software

BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.

 

Free K2 Five Upgrade Review

Note that the executable to this program can be found in the following location: C:Program Files (x86)K2 blackpearlBinSmartObject Service Tester.exe.

A. Refreshing the service instance.

Usually your first reaction would be to refresh the service instance. This is done by right clicking on the service instance and then selecting ‘Refresh Service Instance’, as indicated in the screenshot below:

1 - Refreshing a K2 Service Instance

1 – Refreshing a K2 Service Instance

B. Refreshing the service type

This is unfortunately usually not sufficient in older versions of K2 Blackpearl. I would rather recommend refreshing the entire service type, as this usually successfully updates the service instance to execute the latest version of your code. This is accomplished by right-clicking on the Service Type and selecting the ‘Refresh ServiceType’ option, as indicated below:

2 - Refreshing a K2 Service Type

2 – Refreshing a K2 Service Type

C. Updating the service instance

If your changes are still not reflected when you explore the service instance, the other option is to Update the service instance. This basically re-adds the service instance, and executes all the initialization code again. This is achieved by right-clicking on the service instance and selecting ‘Edit Service Instance’. You then select ‘Next’ in the following screen and then ‘Update’ in the final screen. This process is clarified in the following screen shots:

Step 1:

3 - Updating a K2 Service Instance

3 – Updating a K2 Service Instance

Step 2:

4 - Updating a K2 Service Instance - Service Properties

Step 3:

4 - Updating a K2 Service Instance - Service Details

4 – Updating a K2 Service Instance – Service Details

D. Delete and Re-add the service instance

Under extreme circumstances you might deem it necessary to delete and re-add a service instance. There is one gotcha here which I just want to make you aware off. Most of K2’s relationships and referenes work with Guid’s and before deleting/readding a service instance it is critically important to be aware of this. Before you delete the service instance follow the steps above (in C. Updating the service instance), and take note of the GUID in Step3, also indicated below.

4 - Updating a K2 Service Instance - Service Details after Deletion

4 – Updating a K2 Service Instance – Service Details after Deletion

Write this Guid down! After you have noted the guid you can delete the service instance by right-clicking on it and selecting the ‘Delete Service Instance’ option. You can now re-add it by right-clicking on the Service Type and selecting ‘Register ServiceInstance’. Follow the wizard as indicated in (C. Updating the service instance) and then make sure that you enter this exact GUID in the final step. This will ensure that none of your SmartObjects break, as they will still be referencing this service instance based on the GUID you supply here. The Display Name and System Name does not really matter.

Need further technical advice or support?