K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
Plan Per Slot - No Destinations

Plan per slot - No Destinations

The Plan per slot (no destinations) method is reserved for server events based activities. In this case, destinations cannot be configured and the server creates one activity instance per slot. Activity data can be initialized and used for each instance. This allows each slot to have its own instance of non shared activity data fields. This method has two options available:

Option 1

 In the first option, the number of slots are specified. The slots field can contain text or Process data, Activity data, XML or SmartObject data. Optionally, initialization data can be used which may consist of XML repeating nodes or SmartObject GetList data. As an example, this could be used for a parent process to start a variable number of child processes using IPC events.

Initialization data may contain any unique data that the activity requires. If a SmartObject GetList method or repeating XML node is specified for the initialization data, the server retrieves the next value for each slot, but only until it has reached the number of specified slots. Using the list field, it returns the next record until all the slots are filled while at the same time using the property specified as the initialization data for the new child process as an example.

Option 2

In this option, the number of slots are configured using SmartObject GetList data or repeating XML, which means that the number of slots is equal to the number of records returned by the GetList Method or elements in a repeating XML node that is mapped to this field. When the runtime activity starts, the server gets the number of records or XML elements and starts that many instances of the activity for example a number of child processes started through an IPC Event.

Using the list field, the server creates a slot for each item returned while at the same time using the property specified as the initialization data for the new child process as an example

  • Initialization data is stored in Activity Destination Instance>Instance Data found in the Workflow Context tab of the K2 Object Browser
  • The  Activity Destination Instance>Instance Data property defaults all values into String format. If another format is required, the Inline Functions or the Data Event can be used to convert these into the required format
  • It is recommended to create a Succeeding Rule on the IPC activity if all slots are required to be completed
  • It is not necessary to use an IPC event with this option. Any server events can be used

Scenario Description

In this scenario, Option 2 of this method is discussed

We have a customer who is recruiting people with specific skills. In order to provide them with details as to who is available with the required skills, we've created a SmartBox SmartObject with details related to potential candidates and built processes around this SmartObject to identify candidates who conform to the specified requirements.

Our customer would like details on the candidates with Programming and InfoPath skills. After completion of the process, a Custom Report can be created using the Report Designer in K2 Workspace. By using the filtering option in the Report Designer Wizard, only those candidates who conform to the specified requirements will be displayed and can be exported into another format to suit the customer's needs.

The following diagram shows the process flow between the parent and child processes. 

Fig. 1. Process Flow diagram  

Description

Destination Rule Options
Process Name PotentialCandidates (Parent Process)
Activity Plan Option Plan per slot (no destinations)
Select the number of slots to be created False
Select a list field to determine how many slots should be created True
List field Candidates.Get List.ID
Slot(s) assigned to (Value found in the Activity Destination Instance>Instance Data) Each ID retrieved from the Candidates SmartObject in the PotentialCandidates process
Total number of slots Depending on the number of ID's retrieved from the Candidates SmartObject as used in the PotentialCandidates process
Outcome The server creates one activity instance per slot. Activity data can be initialized and used for each slot

We selected the Candidates.Get List.ID list field on the Destination Rule Options page as shown below. This will enable the server to create a slot for each item returned while at the same time using the property specified as the initialization data for the new child process.

Fig. 2. Destination Rule Options page  

The process is started manually by a user who has Administration rights on the K2 Workflow Server. The K2 Processes and a detailed description of the setup of these processes are shown below these steps. The following steps are performed by the server:

  1. The IPC event of the PotentialCandidates (Parent Process) sends the ActivityInstanceDestInstanceData to the stringcandidateID data field of the CheckAvailabilityandSkills(Child Process) 
  2. The child process converts the data into Integer format, then uses a SmartObject Event to get the candidates' details via the Load Method of the Candidates SmartObject.
  3. A Line Rule evaluates whether the InfoPath and Programming properties of the SmartObject are true. If both are true, the CandidateAvailable data field of the child process) is set to true.
  4. The IPC Event returns the value of the CandidateAvailable data field of the child process and that instance's AllAvailable data field slot of the parent process gets populated with the value.
  5. The parent process sets this instance's InstancesComplete data field slot to True as this instance completes.
  6. A Succeeding Rule checks whether all slots of the InstancesComplete data field evaluates to True. As soon as all the instances have finished running, this Succeeding Rule will succeed and the parent process continue.
  7. Two Line Rules then check whether at least one of the instance's AllAvailable data field slot is set to False, or if all instances of the AllAvailable data field slots are set to True.
  8. If at least one of the instance's AllAvailable data field slot is set to False, the process will complete for this instance as this candidate does not conform to the specified requirements.
  9. If all instances of the AllAvailable data field slots are set to True, the process initiates an activity that will convert the value into Integer format and then use a SmartObject Event to update the Valid Candidate property of the SmartObject to True as this candidate conforms to the specified requirements.

K2 Features used

The following K2 Features are used in this scenario and specific references are made to the Processes and SmartObject as described in the steps above should you wish to recreate this scenario:

Feature Description

Candidates SmartObject

Contains properties that are required to send and receive information between the parent and child processes

PotentialCandidates (Parent Process)

Links to the child process via an IPC event to send and receive information to and from the child process

CheckAvailabilityandSkills (Child Process)

 Links to the parent process via an IPC event to send and receive information to and from the parent process

Candidates SmartObject

This SmartObject contains the following Properties:

PotentialCandidates (Parent Process)

Activity 1

Activity 2

Activity 3

CheckAvailabilityandSkills(Child Process)

Process

Activity 1

Activity 2

Activity 3

See Also

 

 


K2 blackpearl Help 4.6.11 (4.12060.1731.0)