Saving Task Messages

When a task runs, informational or warning messages are shown on the task activity details screen. The messages can change each time a task runs. Services Framework saves the task message parameters in the database. When a warning message is saved, it is flagged with a warning icon. The BaseIPDTask provides a method to save a single task message or multiple task messages at one time during task processing.
Note:
  1. When the task restarts, all associated task messages are deleted before processing starts. A new task message with a message type of informational, a message name of Task Restart/Resume, and a value of Restarted is created.
  2. When the task resumes, all associated task messages are saved before the task resumes processing. A new task message with a message type of informational, a message name of Task Restart/Resume, and a value of Resumed is created.
  3. Invoking the saveTaskMessage( ) or saveTaskMessages( ) methods has no effect except in the runTask( ), endOfDayExec( ) and cleanup( ) methods.
public boolean saveTaskMessage(TaskMessage taskMessage)
   throws TaskProcessingException

public boolean saveTaskMessages(List<TaskMessage> taskMessageList)
   throws TaskProcessingException
For example:
saveTaskMessage(new TaskMessage(TaskMessage.MessageType.WARNING, "XML Directory",
                                "Writing to non-temp directory: " + directory));

List<TaskMessage> taskMessageList = new ArrayList<TaskMessage>();

taskMessageList.add(new TaskMessage(TaskMessage.MessageType.ERROR,
                                    "Invalid user",
                                    getConfigParm(CONFIG_PARM_KEY_USERID)));
taskMessageList.add(new TaskMessage(TaskMessage.MessageType.WARNING,
                                    "Directory Change issued",
                                    "From: " + directory + " To: /temp"));

saveTaskMessages(taskMessageList);