The AE ApplicationInterface also facilitates access to the activities of your AE system.
Use the class "ExecuteObject" to activate objects and get information about the activated object.
ExecuteObject execute = new ExecuteObject(new UC4ObjectName("MM.DAY"));
uc4.sendRequestAndWait(execute);
System.out.println("RunID of the activated task: " + execute.getRunID());
Define a filter using the class "TaskFilter" to read the Activity Window. Then send this request to the AE system via the class "ActivityList". The result can then be checked with an iterator.
TaskFilter filter = new TaskFilter();
filter.setTypeJSCH(false);
filter.setObjectName("MM*");
ActivityList list = new ActivityList(Filter);
uc4.sendRequestAndWait(list);
Iterator it = list.iterator();
if(list.size() > 0)
{
while(it.hasNext())
{
Task task = (Task) it.next();
System.out.println("result: " + task.getName());
}
}
Extra classes are available for all of these actions.
// Stop task
SuspendTask stop = new SuspendTask (task1.getRunID(), false);
uc4.sendRequestAndWait(stop);
// Restart task
ResumeTask go = new ResumeTask (task1.getRunID(), false);
uc4.sendRequestAndWait(go);
// End task
QuitTask quit = new QuitTask (task1.getRunID());
uc4.sendRequestAndWait(quit);
// Deactivate task
DeactivateTask deactivate = new DeactivateTask (task1.getRunID());
uc4.sendRequestAndWait(deactivate);
// Cancel task
CancelTask cancel = new CancelTask (task1.getRunID(), true);
uc4.sendRequestAndWait(cancel);
You can set the PromptSet variables of tasks before they start when one or several PromptSet objects have been assigned to them. You use the method "putPromptBuffer" of the class "ExecuteObject" for this purpose.
//Start Task
ExecuteObject exec = new ExecuteObject(new UC4ObjectName("GEN.SCRI_PROMPT_DEMO"));
//Set Prompt buffer
exec.putPromptBuffer("FIRSTPROMPTSET1", "a");
exec.putPromptBuffer("FIRSTPROMPTSET2", "b");
exec.putPromptBuffer("SECONDPROMPTSET1", "c");
exec.putPromptBuffer("SECONDPROMPTSET2", "d");
System.out.println("Run ID:"+exec.getRunID());
//Read report
Report act = new Report(exec.getRunID(), "ACT");
System.out.println(act.getReport());
See also:
Classes for Objects
Classes for Workflows and Schedules
Classes for Statistics and Reports
Classes for the System Overview