Getting the Originator of the ProcessInstance

  • 8 February 2006
  • 5 replies
  • 1 view

Badge +2
Hi,

When coding events in K2.Studio one can get to the Originator by quering the Orginator property on the ProcessInstance object. The object model used the is from KO.dll

However, from an custom application, one uses the K2Rom.dll. The ProcessInstance class in that object model does not have an Originator property.

Any ideas how I can get the originator from a custom application using the K2Rom (or any other reference I need to do this). Obviously, the point at which I want to get it is if a person has opened a worklist item (and therefore have a valid ProcessInstance)

Thanks for your response(s)
Charl

5 replies

Badge +4
The easy way out is to create a K2.net Datafield called Originator and populate the value when you create an instance of the process.
Badge +2
Yeah I know, but somehow that feels way too much like a hack. If that's the only way, well then fine.

Besides, what if I want to get to the other properties that the K2 User class provides, like email or something. Then for each of those I'll have to create yet another process data field. Messy... :(

Thanks for your reply.

Charl
Badge +2
No other suggestions or solutions? Surely the must be someway to get the originator as a user object back on a client application?

Whould any of the K2 people be able to explain why it was left off the K2Rom ProcessInstance object? Renier? Ockert?

Again, thanks for any help you can provide!

Charl
Badge +11
Unfortunately, I'm not 100% sure why the 'Originator' is not available through the K2ROM object model. Maybe there was a good reason for it like compatibility with previous versions or performance related because this would mean another User object to be populated and resolved from AD, maybe it was an oversight - not sure.

As David has pointed out, the EASIEST way to get to the Originator, would be to store the value into a process level datafield.

Other properties you've mentioned like user name and email address on the other hand IS available through the 'User' class of the K2ROM.

Regards,
Ockert
Badge +2
Hi Ockert,

Thanks for the response. I understand that the User object on the K2Rom has all the properties I want, but there is no way (that I can find) get a specific user back.

You can't create an instance of the User class, no class in the K2Rom gives you the ability to retrieve user information (except the Connection object, but that returns only the logged in user).

Anyways, I guess I'll just have to store the orignator info in the process data, but that doesn't mean I have to like it! :D

Charl

Reply