Informatica ActiveVOS
- Informatica ActiveVOS 9.2.4.6
- All Products
// Assign the server URL to AE_ACTIVEVOS_ENGINE_URL global variable. This is where // the service requests are sent. (note: AE_ACTIVEVOS_ENGINE_URL is global variable // declared in ae-avc-util.js.) AE_ACTIVEVOS_ENGINE_URL = "http://localhost:8080/active-bpel"; // create JSON request for getTasks operation. E.g. get upto 10 unclaimed tasks. var getTasksRequest = AE_TASK_UTIL.createGetTasksRequest( { taskType : AE_TASK_GLOBALS.GETMYTASKS_TASK_TYPE.TASKS, // same as string "TASKS" // same as string "POTENTIAL_OWNERS" genericHumanRole : AE_TASK_GLOBALS.GENERIC_HUMAN_ROLE.POTENTIAL_OWNERS, status : AE_TASK_GLOBALS.TASK_STATUS.READY, // "READY" maxTasks : 10 }); // Create AeTaskApi object and get the task list via getTasks() operation. var taskApi = new AeTaskApi(); taskApi.getTasks( getTasksRequest, // request JSON object function(aJsonResponse) { // success callback of JSON data // handle success response alert("Success!"); // get list of task abstracts (//htdt:getMyTasksResponse/htdt:taskAbstract) var jsonTaskAbstracts = AE_JSON_NODE_UTIL.getElements(aJsonResponse.getTasksResponse.getMyTasksResponse.taskAbstract); var i; for (i = 0; i < jsonTaskAbstracts.length; i++) { // wrap json data in AeTaskAbstract object for convenience accessors. // (see ae-avc-tasks.js for AeTaskAbstract) var taskAbstractObj = new AeTaskAbstract( jsonTaskAbstracts[i] ); alert( "Task id: " + taskAbstractObj.getId() ); alert( "Task name: " + taskAbstractObj.getName() ); alert( "Task status: " + taskAbstractObj.getStatus() ); } }, function(aJsonFault) { // fault callback of JSON data alert( "Fault!"); }, function(aStatusCode, aStatusMessage) { // http error callback alert( "Transport error: " + aStatusCode + " " + aStatusMessage); } );
// ... // setup AE_ACTIVEVOS_ENGINE_URL, and the like // ... 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. var inputPartJson = aTask.getInput(); (// for input by partname, use aTask.getInput('nameOfPart'); }, function(aJsonFault) { alert("Fault!"); }, function(aStatusCode, aStatusMessage) { alert("Transport error: " + aStatusCode + " " + aStatusMessage); } );
var taskApi = new AeTaskApi(); var taskId = "urn:b4p:1234"; // claim taskApi.invokeSimpleWshtRequest( AE_TASK_GLOBALS.SIMPLE_WSHT_OPERATIONS.CLAIM, taskId, function(aClaimResponse) { // success (json data) }, function(aFaultResponse) { // fault (json data) }, function(aStatusCode, aStatusMessage) { //error } ); // start taskApi.invokeSimpleWshtRequest( AE_TASK_GLOBALS.SIMPLE_WSHT_OPERATIONS.START, taskId, function(aStartResponse) { // success (json data) }, // ... fault and error handlers omitted for brevity ... ); // complete taskApi.invokeSimpleWshtRequest( AE_TASK_GLOBALS.SIMPLE_WSHT_OPERATIONS.COMPLETE, taskId, function(aStartResponse) { // success (json data) }, // ... fault and error handlers omitted for brevity ... );
var taskApi = new AeTaskApi(); var taskId = "urn:b4p:1234"; // message part name per wsdl var partName = "response"; // the <loan:loanApprovalResponse /> in JSON. var outputJson = {"loanApprovalResponse": { "xmlns": "http:\/\/schemas.active-endpoints.com\/avoscentral\/LoanRequest\/2009\/07\/avc-loanapproval.xsd", // other attributes and elements omitted for brevity. } }; // set output data taskApi.setOutput( taskId, partName, outputJson, function(aSetOutputResponse) { // success (json data) }, function(aFaultResponse) { // fault (json data) }, function(aStatusCode, aStatusMessage) { //error } );