Customize K2 Worklist Broker


Badge +3

Hi All,

 

I am trying to customize K2 Worklist Broker (http://community.k2.com/t5/K2-blackpearl/Worklist-Service-Broker/ba-p/889) by adding extra columns to it. 

The columns I need are present in another smar object. 

As shown in below picture, I have Worklist Smartobject and my Project Smartobject. I want the name and manager fields from my Project Smarobject to be displayed in the custom worklist. 

17118i424542ABA522403F.png

 

Now the common connection between both the smartobjects is Process Instance ID. Work list Smartobject has the value by default. I am populating the Process ID in my Project Smartobject during workflow trigger. Using this I want to read the Name, Manager fields from Project Smartobject. 

(Example: If process instance Id is 111, then I want to go find 111 in Project Smartobject and then retrieve its corresposnding fields(Name, Manager).).

 

Any help on how this can be achieved?

 

Thanks, 


9 replies

Badge +9

Yes, you can use a composite SmartObject.

 

Instructions can be found here: http://community.rightpoint.com/blogs/viewpoint/archive/2012/09/14/build-a-composite-smartobject-in-15-minutes-or-less.aspx

Badge +7

Hi Rohini,

 

 

As Victoria suggested you can have smartobjects association which definately accomplish your requirement. But to be honest i'm not a fan of composite smartObject for below reason;

 

1) Firstly composite smartObjects will have performance issue especially when you have many list items in the list.

2) As you are talking about custom worklist broker which i had used it before and seen many others have complaining the same,

 

 

Keep above points in mind, i would go ahead with injecting the code retrieves the business data (Project SO data) along with the worlist items. per your comments if Project SMartObject is connecting to a SQL table, then you can easily write a code to retrieve the details from the SQL table directly based on the ProciessInsance as filter. 

 

Hope it helps!

 

 

Cheers,

Prajwal Shambhu

Userlevel 1
Badge +4

I second Prajwal's feeling about composit SmartObjects.

 

I feel that K2 often overly discouraged to write your own code, but there are many instances, such as this, where adding a small amount of your own code can both improve performance and make a clearner and more supportable solution.

 

 

Badge +9

I too have experienced disappointing performance speeds of composite SmartObjects.  I suppose it's good to see I'm not alone,

 

However, I don't understand the code explanation.

Badge +3

Thanks Victoria, Prajwal, Nathan for your helpful replies. 

 

So when you guys say write code to retrieve business data along with worklist items, should I write the custom code to modify the worklist broker? Or something totally separte?

Because my final aim is to have the Worklist page display the business data, so that users can look at the business data before approving requests. 

I am sorry to ask this but is there any example for this or would be great if you can elaborate more. 

 

Any help is much appreciated. 

 

 

Thanks again. 

Badge +10

We often get this type of request from the business.   Instead of creating a customized K2 worklist we recommend populating the process instance's Folio field with the key business identifying information.  The folio field shows up on the K2 Worklist and gives enough context to the destination user to identify the particular task on their worklist. In your case you could use the Data event to add the Name and Manager fields to set the Folio immediately after the workflow starts.  I typically keep it to below 50 characters and will truncate it if necessary.

 

Otherwise as the other posters have described you have to go through a development exercise to create your own worklist control.  Issues with performance can arise if not created carefully (even then might still arise with very large worklist queues) and you also then have to maintain that customer worklist through K2 updates etc.

 

Presented with the pros and cons with the extra cost and development time being the key factors, in my experience they choose the Folio approach.

 

Hope this helps.

Tim

 

Badge +3

 Thanks Tim for your reply.

 

Actually, there is a bunch of business data the user wants to see in the Worklist (around 7 columns). So populating the Folio field is not an option for me. 

But when you mentioned about maintianing the code through K2 upgrades - can you please shed some light on it?

If I do go ahead and write some custom code (which I have no idea on how to do ), will it not be migrated fine when we upgrage to next K2 version?

 

In all probability, we will move to Blackpearl 4.7 when it comes out. 

 

Thanks. 

Badge +10

You're right that 7 columns couldn't be made to fit in the Folio field.  Also ensure the end users have enough screen real estate to fit those 7 extra columns.

 

I'm assuming you're going to be replicating the OOTB K2 Worklist features would would require custom development .  With each update K2 releases you should check your customized K2 worklist control to make sure the update doesn't break it.  It doesn't happen often but sometimes changes in the APIs or the referenced dlls can cause an issue.  That's what I meant by maintaining it.

 

 

Badge +3

Thanks Tim.

 

All,

 

If any one has implemented custom code in their K2 Worklist, cna you please direct me to an example? I am clueless as to how this can be done. 

 

 

Reply