com.ibm.task.spi
Interface StaffQueryResultPostProcessorPlugin


public interface StaffQueryResultPostProcessorPlugin

This interface provides for methods that allow to modify StaffQueryResult data.

This plug-in provides for methods to post process staff result data on different levels. That means, for different roles different methods are called.
Example:

This is a sample list, it is not complete.

Note: The plug-in is available once per installation, so all tasks use this plug-in, that is, the staff results for all tasks are filtered by this plug-in.

Code Sample: (handles the Editor role of a certain task with name "SpecialTask")
import java.util.Collection;
import java.util.Locale;
import java.util.Map;
import com.ibm.task.api.ApplicationComponent;
import com.ibm.task.api.Escalation;
import com.ibm.task.api.EscalationTemplate;
import com.ibm.task.api.Task;
import com.ibm.task.api.TaskTemplate;
import com.ibm.task.spi.StaffQueryResult;
import com.ibm.task.spi.StaffQueryResultFactory;
import com.ibm.task.spi.StaffQueryResultPostProcessorPlugin;
import com.ibm.task.spi.UserData;

public class MyStaffResultProcessor
implements StaffQueryResultPostProcessorPlugin
{
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
ApplicationComponent applicationComponent,
int role,
Map context)
{ return(originalStaffQueryResult); }

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
Escalation escalation,
Task task,
int role,
Map context)
{ return(originalStaffQueryResult); }

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
EscalationTemplate template,
int role,
Map context)
{ return(originalStaffQueryResult); }

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
Task task,
int role,
Map context)
{
StaffQueryResult newStaffQueryResult = originalStaffQueryResult;
StaffQueryResultFactory staffResultFactory = StaffQueryResultFactory.newInstance();
if (role == com.ibm.task.api.WorkItem.REASON_EDITOR &&
task.getName() != null &&
task.getName().equals("SpecialTask"))
{
UserData user = staffResultFactory.newUserData("SuperEditor",
new Locale("en-US"),
"SuperEditor@company.com");
Collection userList = newStaffQueryResult.getUserData();

userList.clear();
userList.add(user);
}
return(newStaffQueryResult);
}

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
TaskTemplate template,
int role,
Map context)
{ return(originalStaffQueryResult); }
} // end of class MyStaffResultProcessor

Register this plug-in by adding a Custom Property with name "Staff.PostProcessorPlugin" to the Human Task Container on the AdminConsole. The value for this Custom property is the name of your implementing class.

Since:
6.0.2
Version:
6.0.2

Method Summary
 StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, ApplicationComponent applicationComponent, int role, java.util.Map context)
          This method is called when the StaffQueryResult is queried for a role on the ApplicationComponent, for example 'Potential Instance Creator'.
 StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, Escalation escalation, Task task, int role, java.util.Map context)
          This method is called when the StaffQueryResult is queried for a role on escalations, for example 'Escalation Receivers'.
 StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, EscalationTemplate template, int role, java.util.Map context)
          This method is called when the StaffQueryResult is queried for a role on escalation templates, for example 'Escalation Receivers'.
 StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, Task task, int role, java.util.Map context)
          This method is called when the StaffQueryResult is queried for a role on tasks, for example 'Readers, ...'.
 StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, TaskTemplate template, int role, java.util.Map context)
          This method is called when the StaffQueryResult is queried for a role on task templates, for example 'Readers, ...'.
 

Method Detail

processStaffQueryResult

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
                                                ApplicationComponent applicationComponent,
                                                int role,
                                                java.util.Map context)
This method is called when the StaffQueryResult is queried for a role on the ApplicationComponent, for example 'Potential Instance Creator'.

Parameters:
originalStaffQueryResult - the original result of the staff query
applicationComponent - application component data (API object)
role - enum for the assignment reason (i.e. POTENTIAL_INSTANCE_CREATORS, ..
context - additional context to be passed to the plugin (primarily for extensibility)
Returns:
modified StaffQueryResult

processStaffQueryResult

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
                                                Escalation escalation,
                                                Task task,
                                                int role,
                                                java.util.Map context)
This method is called when the StaffQueryResult is queried for a role on escalations, for example 'Escalation Receivers'.

Parameters:
originalStaffQueryResult - the original result of the staff query
escalation - escalation data (API object)
task - task data (API object)
role - enum for the assignment reason (i.e. ESCALATION_RECEIVER, ..
context - additional context to be passed to the plugin (primarily for extensibility)
Returns:
modified StaffQueryResult

processStaffQueryResult

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
                                                EscalationTemplate template,
                                                int role,
                                                java.util.Map context)
This method is called when the StaffQueryResult is queried for a role on escalation templates, for example 'Escalation Receivers'.

Parameters:
originalStaffQueryResult - the original result of the staff query
template - escalation template data (API object)
role - enum for the assignment reason (i.e. ESCALATION_RECEIVER, ..
context - additional context to be passed to the plugin (primarily for extensibility)
Returns:
modified StaffQueryResult

processStaffQueryResult

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
                                                Task task,
                                                int role,
                                                java.util.Map context)
This method is called when the StaffQueryResult is queried for a role on tasks, for example 'Readers, ...'.

Parameters:
originalStaffQueryResult - the original result of the staff query
task - task data (API object)
role - enum for the assignment reason (i.e. POTENTIAL_OWNER, ADMINISTRATOR, ..
context - additional context to be passed to the plugin (primarily for extensibility)
Returns:
modified StaffQueryResult

processStaffQueryResult

public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
                                                TaskTemplate template,
                                                int role,
                                                java.util.Map context)
This method is called when the StaffQueryResult is queried for a role on task templates, for example 'Readers, ...'.

Parameters:
originalStaffQueryResult - the original result of the staff query
template - task template data (API object)
role - enum for the assignment reason (i.e. POTENTIAL_OWNER, ADMINISTRATOR, ..
context - additional context to be passed to the plugin (primarily for extensibility)
Returns:
modified StaffQueryResult