K2Mng / Process Data / Custom workspace

  • 4 September 2008
  • 4 replies
  • 4 views

Badge +7

Hi

I have a feeling I know the answer to this but I figured it was worth asking if anyone had a clever solution.

Let's say I use the K2Mng API to load a WorkListItems collection. How can I read process data from the individual WorkListItem objects, assuming that they are not assigned to me nor am I the manager of the user they are assigned to?

OK - so I realize that I can redirect the item to myself,  look it up in my own Worklist using K2ROM, get whatever data I need, and then redirect it back to the original user. I think that is clunky but it is the only solution that I see.

But in that case how does the Workspace do it? In the workspace I can click on any process and view it's process data. Does the workspace just bypass the API and query the database directly? Does it use some web service? Is there any way we can emulate that functionality? Any good articles on implementing a custom workspace that I could use for ideas?

 Many thanks in advance, Richard


4 replies

Badge +5

Here are 2 possible ways to acheive that:



  • Use K2MNG, you need to have admin permission on the process, open the process instance and iterate over the datafields.
  • Workspace way, you need to connect to the web service of workspace to get the same data as in the workspace.

 

Badge +7

Hi Yousef

Thanks for replying.

It's not quite as straightforward as iterating the process instances using K2Mng though, because the the SourceCode.K2Mng.ProcessInstance class is not the same as the SourceCode.K2ROM.ProcessInstance class. Specifically, the K2Mng.ProcessInstance class does not have the datafields property.

So for that approach I would need to locate the SourceCode.K2Mng.ProcessInstance based on what data is available in the WorkListItem (say, searching by start date, folio and process name) (which seems to be not 100% reliable, I supposed depending on the start dates / use of unique folios), then I can use the ID property of my K2Mng.ProcessInstance to locate and open the matching SourceCode.K2ROM.ProcessInstance.

Unless I'm missing something, it all seems like a bit of a headache.

Is there any documentation on the workspace web service? Is using it from our applications supported?

Thanks again,

 Richard

Badge +13

The workspace webservice adheres to the permission security.

You can add a system ID to the destination and then use K2ROM under that system's ID in the application pool to pull out datafields when run as .aspx w/impersonation = false.

Badge +7

Thanks Peter.

This may be what I'm looking for. I don't think security is going to be an issue because the user accessing this will have "View" permissions on the processes I'm interesting in anyway.

I will have to look into using the web service.

Thanks again,

Richard

Reply