SmartObject List Method and setting Destination Users dynamically

Last post 04-29-2008, 8:09 PM by sams. 0 replies.
Sort Posts: Previous Next
  •  04-29-2008, 8:09 PM 23470

    SmartObject List Method and setting Destination Users dynamically

    There are many ways to set Destination User dynamically inK2 BlackPearl.  Sometimes, you may wish to use a SmartObject List methodto retrieve a list of users from an outside data source.  If you call thelist method within the Destination Rule directly and a list of users isreturned, it appears most existing ServiceBrokers will not return the data inan acceptable form.  However, you can work around this using a process XMLfield with a repeating node where the repeating node is set as the Destination.For example, for the following XML field called DestUsers, the ’Name’ elementis a repeating node that includes two users:


    <User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Name>K2:K2DEMO\Administrator</Name>
    <Name>K2:\K2DEMO\suzans</Name>
    </User>

    When the Destination is set to the repeating node of the xml field, each userin the repeating node will become a Destination User. Note that the xml fieldname will display in the Destination Rule as "DestUsers_Name", where"DestUsers" is the xml field name and "Name" is therepeating node that contains the name of each destination user.  Obviously, this will require some code (in a Server Event) to make this happen. 

    - Sam and Blake


    --------------------------------------------------------------------------------
    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.
View as RSS news feed in XML