K2 Workflow Designer - Task Allocation Role Methods

This content applies to legacy design tools (such as K2 Studio, K2 for Visual Studio, or the Silverlight-based K2 workflow design tool). If you have upgraded from K2 blackpearl 4.7 to K2 Five, these tools may still be available in your environment. These legacy tools may not be available in new installations of K2 Five. These legacy tools may also not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component support policy for more information about support for these components.

It is important to note that SmartObjects will only be available in the SmartObjects tool bar once it has been selected to be used in workflows in the SmartObject Designer. In order to make this SmartObject available in the K2 Workflow Designer, edit the SmartObject and select to "Allow this SmartObject to be used in Workflows" on the Details screen of the SmartObject Designer

The Role Methods comprise of the following:

  • Get Least Work - Will return the user with the least amount of work.
  • Get Most Work - Will return the user with the most work.
  • Get Round Robin - Works in conjunction with the RoundRobin SmartObject, which stores users in the SmartBox table and Round Robins the work.
  • Get Fastest User - Will return the fastest user.
  • Get Slowest User - Will return the slowest user.
  • Get Role Peers - Will return the current user's peers.

Single Method

The following single methods can be found by selecting the SmartObjects tab in the K2 Workflow Designer, then selecting the Task Allocation  - Role Methods SmartObject from the list of SmartObjects available. 

  • Get Least Work
  • Get Most Work
  • Get Round Robin
  • Get Fastest User
  • Get Slowest User

Drag the method onto an activity.

Fig. 1. Single Method

The SmartObject Wizard opens and the Input Properties screen is displayed. Tick the Update box next to the properties and specify the values for the required input properties. Click Next.

Fig. 2. Input Mapping screen

The Return Property screen is displayed. Specify the property to be returned. Click Finish.

Fig. 3. Select a Return property

List Method

The Get Role Peers Method of the Task Allocation - Role Methods SmartObject can be found by expanding the SmartObjects node in the Context Browser, then navigating to Task Allocation - Role Methods. Drag the property into the required field.

Fig. 4. List Method

The SmartObject Wizard opens and the parameters screen is displayed. Specify the values for the required input properties. A Filter can be applied to decrease the number of results to be returned. Click Next.

Fig. 5. SmartObject Input Mapping

Filter Options What it is How to use it
Add Adds a new instance of a filter  Click Add to add a new instance of a filter
Remove Removes an existing instance of a filter Select a filter, then click Remove
Insert Inserts a new instance of a filter above the filter that is currently selected Select a filter, then click Insert
Group Groups two or more instances of a filter together Select the instances and click Group
Ungroup Undo the grouping of instances of a filter Select the instances and click UnGroup

The Return Property screen is displayed. Select the property to be returned. Results can be ordered Ascending or Descending. Select the option most suitable from the List Options to return the list. Click Finish.

Fig. 6. SmartObject Return property screen

Order Options What it is How to use it
Order results by Results can be ordered Ascending or Descending Select the option
Property This is the property that will be returned Select the property from the Context Browser
List Options What it is How to use it
Return a single item Returns only a single item as specified in the Select item drop down or Index field Choose First, Last or Index from the Select item drop down
Select item

The following options are available from the drop down":

  • First
  • Last
  • Index
Select the required option from the list
Index A specific item can be specified to be returned  Select Index from the Select item drop down and type the item number that should be returned, i.e. 5 
Return all items that match filter Returns all the items that match the filter criteria Select the option