Dynamic Destination Users from datasource

Last post 12-09-2008, 9:55 AM by k2.netdeveloper. 6 replies.
Sort Posts: Previous Next
  •  05-02-2008, 4:22 PM 23555

    Dynamic Destination Users from datasource

    I'd like to be able to use a different datasource i.e. SQL to hold the users. Then, depending on certain datafield values, I'll send the process instance to a or many users that are queried for based on the criteria.

     I'm having a tough time getting to the destination user part of K2ROM, if it even exists.

     Does anyone have any thoughts on setting up dynamic destenation users using .NET server code.

    Thanks,

    Z

  •  05-02-2008, 4:59 PM 23556 in reply to 23555

    Re: Dynamic Destination Users from datasource

    you can use SQL out of the box without having to write code by using the SQLUM. If you want to get at roles you can use

    SourceCode.Workflow.Management Namespace

    but to just add destination users you can add them like this

    // Add some destination users

                SimpleDestinationRule destinationRule = new SimpleDestinationRule();

                DestinationSet defaultDestinationSet = new DestinationSet();

                Destination destination1 = new Destination();

                destination1.Type = DestinationTypes.User;

                destination1.Value = K2FieldFactory.CreateK2Field("K2:Domain\\User1");

                Destination destination2 = new Destination();

                destination2.Type = DestinationTypes.User;

                destination2.Value = K2FieldFactory.CreateK2Field("K2:Domain\\User2");

     

                defaultDestinationSet.Destinations.Add(destination1);

                defaultDestinationSet.Destinations.Add(destination2);

     

                destinationRule.DestinationSets.Add(defaultDestinationSet);

     

                // Set the destination rule of the activity

                awaitApprovalActivity.DestinationRule = destinationRule;

  •  05-03-2008, 5:01 PM 23561 in reply to 23555

    Re: Dynamic Destination Users from datasource

    Could you help me understand your question better?  Do you want to store users who are not in AD in a database, or do you want to dynamically select users for a destination based on some criteria. 


    The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.
  •  05-04-2008, 9:01 AM 23568 in reply to 23561

    Re: Dynamic Destination Users from datasource

    Also, please confirm that you are using K2 blackpearl. 

    K2ROM is actually the K2.net 2003 runtime API.  K2 blackpearl has more options around how to handle Activity Destinations than K2 2003 so it is important to understand what version you are using.


    The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.
  •  05-05-2008, 3:20 PM 23590 in reply to 23556

    Re: Dynamic Destination Users from datasource

    Where would I find the K2FieldFactory?

    And I'm a little confused with the activity since the KO activity doesn't have the desination rule property.

     Am I suppose to enter this code in a server code event or in something else?

     As you can tell I'm new to this object model.

    Thanks,

    Z

  •  05-05-2008, 4:07 PM 23592 in reply to 23556

    Re: Dynamic Destination Users from datasource

    well the simple part was actually taken from the Developer reference. but to get at destrules you would use

     

    sourcecode.workflow.authoring

  •  12-09-2008, 9:55 AM 27657 in reply to 23590

    Re: Dynamic Destination Users from datasource

     Zeppelin, were you able to make it work ? Appreciate if you could share the solution.

     

    Thanks in Advance 

View as RSS news feed in XML