How Set Destination User In Activity

  • 5 March 2008
  • 2 replies
  • 0 views

Badge +1

when i create a smartobject name approver from k2blackpearl same like this


- DeptID 


- ApprovalName


and when i design workflow i put a activity to flow , i don't know the destination user who to approve for each department at design time but i know who are destination user for approve at the runtime ( Web Form ) - i query destination user form sql in base name smartbox and in the table approver this i have problem how i set the destination user from my dataset to destination user in activity by coding in vb.net 2005


2 replies

Badge +11

You can use the same SmartObject as a destination if you have the DeptID stored in your workflow.  On your activity, go to the destination settings.  Click the elipsis (...) by the destination. Go to SmartObject Servers and dirll down to the load method of your SmartObject. Add the Load method to the destination field and a wizard will pop up.  Map the input DeptID property to your DeptID and highlight the ApprovalName (hopefully UserID) to use it as the result.


 If you still want to use code, right-click on the activity | View Code | Destination Rule.  On the WF code event, right-click and click View Code.  Replace the code in the DestinationRule_ExecuteCode with something like this:


 K2.Destinations.Add(DestinationType.User, approvalName);


where approvalName is the UserID of the user you want to use as the destination.

Badge +2
thx man~

Reply