Informatica ActiveVOS
- Informatica ActiveVOS 9.2.4.6
- All Products
// ... // setup AE_ACTIVEVOS_ENGINE_URL etc. // ... var taskApi = new AeTaskApi(); taskApi.getInstance( "urn:b4p:1235", // task ID function(aTask) { // handle success response // aTask is an instance of AeTask (see ae-avc-tasks.js). alert( "Got task, id: " + aTask.getId() ); alert( "Task name: " + aTask.getName() ); alert( "Task status: " + aTask.getStatus() ); // aTask.getJson() returns the underlying raw JSON data structer. // aTask.getOwner() returns current owner. }, function(aJsonFault) { alert("Fault!"); }, function(aStatusCode, aStatusMessage) { alert("Transport error: " + aStatusCode + " " + aStatusMessage); } );
// // Task is an instance of AeTask, obtained via AeTaskApi.getInstance(...) // (assuming using the Loan Approval human task example) // // <message name="WshtLoanInput"> // <part name="request" element="loan:loanProcessRequest" /> // </message> // <message name="WshtLoanOutput"> // <part name="response" element="loan:loanApprovalResponse" /> // </message> var loanRequestInput = task.getInput("request"); // 'request' is the part name // Note: task.getInput() returns first available part since part name is not given. alert("Firt Name = " + loanRequestInput.loanProcessRequest.firstName); alert("Loan Amount = " + loanRequestInput.loanProcessRequest.amountRequested);
var loanOutput = task.getOutput("response"); // 'response' is the output part name // check for null in case output is not set. if (loanOutput != null) { alert("Approved? = " + loanOutput.loanApprovalResponse.responseToLoanRequest); }
// First time use, create JSON output: // var loanOutput = { {"loanApprovalResponse" : ... }}; // or getOutput() to access current value if the output has already been set. var loanOutput = task.getOutput("response"); // modify data AE_JSON_NODE_UTIL.setText(loanOutput.loanApprovalResponse.responseDescription, "Some Text"); // Set output (in-memory only) task.setOutput("response", loanOutput); // Now, save all available parts to the server using the AeTaskApi. var taskApi = new AeTaskApi(); task.saveOutputParts( taskApi, function(aSetOutputResponse) { // success (json data) }, function(aFaultResponse) { // fault (json data) }, function(aStatusCode, aStatusMessage) { //error } );