Question: How to execute an object with promptset via Java api (Application Interface) in AE v9 and v10?
Resolution:
Executinga job or a workflow with Prompset via Java api is not the same with AE v9 and v10
In v10, there isa new function called "putPromptBuffer"in class "ExecuteObject". With this function, the value of each prompsetvariable could be stored in the buffer before executing the object thatcontains the prompsets. So the steps to execute an object with promptsets are:
Example:
//Step 1: initiate the executable object
ExecuteObject exec = newExecuteObject(new UC4ObjectName("GEN.SCRI_PROMPT_DEMO"));
//Step 2: Put the promptset's values to the buffer
exec.putPromptBuffer("FIRSTPROMPTSET1","a");
exec.putPromptBuffer("FIRSTPROMPTSET2","b");
exec.putPromptBuffer("SECONDPROMPTSET1","c");
exec.putPromptBuffer("SECONDPROMPTSET2","d");
//Ste 3: Execute the object
uc4.sendRequestAndWait(exec);
In v9, there's no similar function to "putPrompBuffer" as inv10. The approach is:
Example:
//Inthe main flow:
waitForPrompt = newCountDownLatch(1);
ExecuteObject exec = newExecuteObject(new UC4ObjectName("GEN.SCRI_PROMPT_DEMO"));
uc4.sendRequest(exec, this);
waitForPrompt.await();
SubmitPrompt submit = newSubmitPrompt(names, promptSets.toArray(newTaskPromptSetContent[promptSets.size()]));
uc4.sendRequestAndWait (submit);
//Overwritethe call back functions of the DefaultNotificationListener to count down the countdownlatch
public void promptInputRequired(intrun) {
waitForPrompt.countDown();
}
public voidhandleIOException(IOException e) {
waitForPrompt.countDown();