Manual Parameters
The Services Framework allows a task to be initiated manually through the user interface. When the task is initiated manually, it must be determined which parameters are presented to the user.
Example
A custom task needs to be written that generates an XML document
for a specific business day. Business days in Common Services are represented
by the following pieces of information:
- Site
- Business day
- Category
The same techniques are used for initializing manual parameters
as with configuration parameters, which are described in Configuration Parameters. In the example, unique keys are assigned
to the parameters.
private static final String MANUAL_PARM_KEY_SITE = "SITE";
private static final String MANUAL_PARM_KEY_BDAY = "BDAY";
private static final String MANUAL_PARM_KEY_CATEGORY = "CATEGORY";To add inline help, use the addManualParameterInlineHelp() method.
An example is shown here:
addManualParameterInlineHelp (new StringBuffer()
.append("Please enter the business day information for running this task.")
.toString());To add manual parameters, use the addManualParameter() method.
An example is shown here:
addManualParameter(MANUAL_PARM_KEY_SITE, "Site",
"The site associated to the business day. This field must be numeric",
true);
addManualParameter(MANUAL_PARM_KEY_BDAY, "Business Date",
"The business date. Example: 2009-01-28",
true);
addManualParameter(MANUAL_PARM_KEY_CATEGORY, "CATEGORY",
"The business category. ",
true); Refer to the Javadoc information for additional information about methods and signatures.