How to use ouput variables as camVariable for embedded form?

i have output Variable restResponse ( it is a json array) i want to wrap it as a camVariable ( later i want to implement all this data in tables)
1.i have tried to get this resTresponse from previous processor ( in script Task i have trasnform it as an output variable)
2. then use ExecutionListener in user task process, for this reason i have added this java class for wrapping my data as output Variable
here is listener example

public class FormListener implements TaskListener {
	public void notify(DelegateTask arg0) {
		
		Integer id = (Integer) arg0.getVariable("id");
		String organizationNameGE=(String) arg0.getVariable("organizationNameGE");
		String organizationNameEN=(String) arg0.getVariable("organizationNameEM");
		String cardNumber=(String) arg0.getVariable("cardNumber");
		arg0.setVariable("id",id);
		arg0.setVariable("organizationNameGE",organizationNameGE);
		arg0.setVariable("organizationNameEN",organizationNameEN);
		arg0.setVariable("cardNumber",cardNumber);
		
		
	}
}

and then i use this script task for embedded html form:

inject(['$scope', '$http', function($scope, $http) {
    var variableManager = camForm.variableManager;

    // OnFormLoaded
    camForm.on('form-loaded', function() {
      // Fetch Variables
      // - General
      variableManager.fetchVariable('processInitiator'); // set by the engine
      // - Process
      variableManager.fetchVariable('id'); // set in an earlier form
      variableManager.fetchVariable('organizationNameGE');
      variableManager.fetchVariable('organizationNameEN');
      variableManager.fetchVariable('cardNumber');
    });

    // OnVariablesFetched
    camForm.on('variables-fetched', function() {
      // After the variables are fetched, bind the value to the angular scope
      // - General
      $scope.processInitiator = variableManager.variable('processInitiator').value;

      // - Process
      $scope.id = variableManager.variable('id').value;
      $scope.organizationNameGE= variableManager.variable('organizationNameGE').value;
      $scope.organizationNameEN = variableManager.variable('organizationNameEN').value;
      $scope.cardNumber=variableManager.variable('cardNumber').value;

    });

AFTER THIS OPERTAION I WANT TO IMPLEMENT THIS DATA INSIDE MY TABLE

<h2>My job List</h2>
    	<div>
    		<table style="width:100%;">
    			<thead>
    				<tr>
    					<th style="width:140px;">id</th>
    					<th style="width:305px;">organizationNameEN</th>
    					<th style="width:250px;">organizationNameGe</th>
    					<th style="width:75px;" >cardNumber</th>
    					<th></th>
    				</tr>			
    			</thead>
    			<tbody ng-repeat="item1  in item">
    				<tr>
    					<td><input style="width:140px;" type="text" value="{{item1.id}}" readonly /></td>
    					<td><input style="width:305px;" type="text" value="{{item1.organizationNameEN}}"  /></td>
    					<td><input style="width:250px;" type="file" value="{{item1.organizationNameGe}}"  /></td>			
    					<td><input style="width:75px;"  type="text" value="{{item.cardNumbercardNumber}}" readonly /></td>
    					<td><input style="width:25px; height:25px;" type="checkbox" ng-model="chekselct"								 					 
    							   								    cam-variable-name="isItemSelected"													
    							   								    cam-variable-type="Boolean" /></td>				   								    
    					<td ng-show="chekselct">extra Data: <input style="width:60px;" type="number"
    																	   		    cam-variable-name="id" min="1"
    																	   		    cam-variable-type="Integer" /></td>	
    				</tr>
    			</tbody>
    		</table>
    	</div>

but every time i try to implement this or similar logic i got errors like this SPIN/JACKSON-JSON-01004 Unable to find ‘id’;
what should i change to make this process work?

Hi @Sally,

do you check whether your process variables really exists in the task listener implementation?

In which step do you set the process variables?

Cheers
kristin

hi @kristin
thank you for your reply, i use processor with similar queue : INvoke Service->Trasnform response data->Form test( where i have embeded index.html form with TaskListener called FormListener and then i have task form for serilizing generated forms

Hi @Sally,

Why do you use the TaskListener? Do you use it only for getting and setting the same variables without changing the variable values? Or do you have more code in it?

In your html form, you don’t need the inject function when you don’t use $http. The variable $scope already exists through the usage of the cam-script attribute.

I don’t know why you get the exception.

I think, you should check whether the process variables exist. Maybe you could write the value of the variables in the log file or you check the database content.

Cheers
kristin