com.ibm.task.spi
Interface StaffQueryResultPostProcessorPlugin
- public interface StaffQueryResultPostProcessorPlugin
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:
- Potential Creator: processStaffQueryResult(StaffQueryResult, TaskTemplate, int, Map);
- Potential Owner: processStaffQueryResult(StaffQueryResult, Task, int, Map);
- Escalation Receiver: processStaffQueryResult(StaffQueryResult, Escalation, Task, int, Map);
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")) { Map userDataMap; UserData userDataObj; // get the user data map from passed staff query result and clear // the map. Then add a new Editor (new UserData instance) userDataMap = newStaffQueryResult.getUserDataMap(); userDataMap.clear(); userDataObj = staffResultFactory.newUserData("MyEditor", new Locale("en-US"), "MyEditor@company.com"); userDataMap.put(userDataObj.getUserName(), userDataObj); } 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.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
COPYRIGHT1
|
Method Summary
Modifier and Type | Method and Description |
---|---|
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 Creator'.
|
|
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'.
|
|
processStaffQueryResult(StaffQueryResult originalStaffQueryResult,EscalationTemplate template,int role,java.util.Map context)
For future use.
|
|
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, Potential Owner, Admins, Editors, ...'.
|
|
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, Potential Owner, Admins, Editors,
etc.'.
|
Field Detail
COPYRIGHT1
- static final java.lang.String COPYRIGHT1
Method Detail
processStaffQueryResult
- StaffQueryResult processStaffQueryResult( StaffQueryResult originalStaffQueryResult,
- ApplicationComponent applicationComponent,
- int role,
- java.util.Map context)
originalStaffQueryResult
- the original result of the staff query applicationComponent
- application component data (API object) role
- enum for the assignment reason (POTENTIAL_INSTANCE_CREATORS) context
- additional context to be passed to the plugin (primarily for extensibility) processStaffQueryResult
- StaffQueryResult processStaffQueryResult( StaffQueryResult originalStaffQueryResult,
- Escalation escalation,
- Task task,
- int role,
- java.util.Map context)
It is called when an escalation is fired and the escalation receivers are being determined.
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) processStaffQueryResult
- StaffQueryResult processStaffQueryResult( StaffQueryResult originalStaffQueryResult,
- EscalationTemplate template,
- int role,
- java.util.Map context)
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) processStaffQueryResult
- StaffQueryResult processStaffQueryResult( StaffQueryResult originalStaffQueryResult,
- Task task,
- int role,
- java.util.Map context)
It is called when a task is started and the role members for admins, readers, editors. etc. are being determined.
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) processStaffQueryResult
- StaffQueryResult processStaffQueryResult( StaffQueryResult originalStaffQueryResult,
- TaskTemplate template,
- int role,
- java.util.Map context)
It is called when a task is created and the role members for admins, readers and potential creators are being determined. It can be also called when the API method 'isUserInRole(TKTID, user, role)' is invoked.
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)
It is called when an ad-hoc task template or ad-hoc task instance is being created. It also can be called for a deployed task templates if that template does not define Potential Creators.