Add destination Users in server event

  • 9 December 2008
  • 3 replies
  • 0 views

Badge +8

Greetings Everyone,

I do not have destination rule defined in activity, destination rule's value is a datafield which has some default value. First event of this activity is server event. I want to add destination users of current activity through this server event.

SourceCode.Workflow.Management.Destination destination1 = new SourceCode.Workflow.Management.Destination();               ?

 

Any ideas would be appreciated.

 

Thanks in advance


3 replies

Badge +3

Hi,


I do not understand what you mean. You cannot add destinations in an event, because each event in an activity is executed per destination, so the destinations must exist.


You can change the destinations of an activity via code only in the "destination rule" code. (Activity context menu->View Code->Destination Rule).


If you mean, that you want to get the current destination user within the server code event, then you do it like this:
K2.ActivityInstanceDestination.User
This is only possible if you use "plan per destination" in you activity.


marco

Badge +9

As marcow states, you can't add a Destination to the currently an activity from a server event within that Activity.  However you can "Delegate" it to someone else.  Delegation just means someone else is granted permission to interact with this worklist item; but the actual number of destinations is not changed.  There is an example of how to implement this delegation here:

 

http://k2underground.com/blogs/fromthebench/archive/2008/07/24/how-to-delegate-undelegate-a-worklistitem-via-api.aspx

 

Badge +8
thanks bob n marcow

Reply