|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
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")
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult,
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); }
Escalation escalation,
Task task,
int role,
Map context)
{ return(originalStaffQueryResult); }
EscalationTemplate template,
int role,
Map context)
{ return(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);
}
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.
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 |
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, ApplicationComponent applicationComponent, int role, java.util.Map context)
originalStaffQueryResult
- the original result of the staff queryapplicationComponent
- 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)
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, Escalation escalation, Task task, int role, java.util.Map context)
originalStaffQueryResult
- the original result of the staff queryescalation
- 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)
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, EscalationTemplate template, int role, java.util.Map context)
originalStaffQueryResult
- the original result of the staff querytemplate
- 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)
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, Task task, int role, java.util.Map context)
originalStaffQueryResult
- the original result of the staff querytask
- 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)
public StaffQueryResult processStaffQueryResult(StaffQueryResult originalStaffQueryResult, TaskTemplate template, int role, java.util.Map context)
originalStaffQueryResult
- the original result of the staff querytemplate
- 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)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |