2 Replies Latest reply on Aug 29, 2014 12:08 PM by George Sibiya

    Completing a human task from JS through REST

    George Sibiya Newbie

      Hi All,

       

      I have this code:

       

      var request = XMLHttpRequest();
      function executeTask(request, url,params){
        request.open("POST", url, true);
        console.log("httpprequests -- "+ url);
        request.setRequestHeader("ACCEPT","application/json");
        request.onreadystatechange = function(){
        if (request.readyState === 4 && request.status === 200){
        if(checkOutcomes(request.responseText && !completeRequested)){
        executeRequest(request,completeTastRequest,params);
        completeRequested = true;
        }
        }else{ 
        });
      
      
        }
        }
        };
        var results = {"map_input1":params.input1,"map_input2":params.input2,"map_input3":params.input3};
        console.log(TAG+" 52 Params "+JSON.stringify(results));
        request.send(results);
        }
      

       

      But my task does not seem to receive the values in line 19. I even print them out in line 20 thay are as I expect them.

      The subsequent task that utilizes these values which are supposed to be written on global variables gets them as null.

      When the processes is executed through the Kie workbench all works fine.

      What am I missing, is my array correctly formatted?

       

      G