how to set service task results into a camunda form

0

Currently I’m trying to implement fetching task results into a camunda form because each result have multiple values and user going to choose which value is best. I’m trying to use camForm.variableManager but it’s returing undefined. How can I achive this, any references,examples please suggest.

I tried to use below code:

 <script cam-script type="text/form-script">
        var variableManager = camForm.variableManager;    
        var jobRequestInfo = $scope.jobRequestInfo = {};
        camForm.on('variables-fetched', function() {
            alert(Object.values(variableManager.variables));
            console.log(camForm.variableManager.variable( 'a' ));
          });
    </script>

I was sending result from pool A to pool B, by using expression stament.

${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("changerequirement").setVariable("a", 1).correlateWithResult()}