Create Single Activity Instance for Queue in Destination Rul

  • 1 December 2006
  • 6 replies
  • 0 views

Badge +13
If queue is used and Create Single Activity Instance for Queue in Destination Rule is checked (regardless if "Use Dynamic Queues for this Activity" is checked), the Client Event for SMTP notification will fail with the below message if it is set to "Destination User".

System.Exception: Object reference not set to an instance of an object.
at K2Code939.Main(ClientEventContext K2)


Also I can not do anything with K2.ActivityInstanceDestination.DestQueue.Name either, I'd get the error below.

Type 'SourceCode.KO.DestQueue' in assembly 'KO, Version=3.3295.1.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

6 replies

Badge +8
Hi Peter,

The General Design Considerations section of the following KB article describes this issue: http://kb.k2workflow.com/articles/kb000155.aspx

"The runtime implementation of this forces K2.net Server to create a single Activity Instance and assign that instance to the Destination queue rather that the actual users. The only time that the item is associated with a specific user is when the user opens the item using the K2.net Worklist or custom implementation of the K2.net Worklist. The result of this can cause mail events using the "Send to Destination User" to fail. This can cause a runtime exception that will be logged in the K2.net Error Profile."

-Eric
Badge
So how would you access the details of the user that completed the client event if the destincation of the activity will always be the queue?

Say you had a server event later down in the activity, code like K2.ActivityInstanceDestination.User is invalid becuase the destination of the activity stay the queue. I cannot find a way to find out who the lucky user was that completed the client event when using a single instance? Its not even visible in the Workspace.
Badge +13
Hopefully to be fixed in SP5, but for now my client app would have to record the completed user ID in an ActivityInstanceData or ProcessData field CompletedByID.....
Badge +13

I just got this error...

Type 'SourceCode.Logging.LoggerException' in assembly 'SourceCode.Logging, Version=3.6262.1.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. 

Badge +5

Hi Peter,


There was a HotFix released for this issue. You can download it on the portal site at the hotfix section. The Fix you need is K2.net® 2003 Hotfix 2. Hope this helped.


Gert

Badge +13

Thanks for the confirmation, I saw that hotfix but wasn't sure if it applied to my case since the object was different.  SourceCode.Logging.LoggerException.

 I removed all references to use the Logger class (logged to Server Event instead), the error disappeared.   If I encounter similiar error again I will give that hotfix a try.
 

Reply