title: Assets are not getting update in for-loop
body: <p>I am trying to use for-loop in the transaction. The for-loop basically creates new assets, ie. I am creating a new asset on each iteration.</p>
  
  <p>The problem is that each time the loop iterates the value of <code>vals.length</code> remains zero(0). And if I try to do <code>console.log(vals)</code> then too it shows null array even when loop iterates for <code>i=1,2,3...</code></p>
  
  <p>But once whole transaction function gets completed then I am able to see the assets in UI.</p>
  
  <h2>model.cto</h2>
  
  <pre><code>asset Net identified by NetNumber{
      o String NetNumber
      o Integer totaltransaction
  }
  
  transaction GenerateNet {
  
  }
  </code></pre>
  
  <h2>logic.js</h2>
  
  <pre><code>/**
  * submit an order
  * @param {org.demo.invoice.GenerateNet}
  * @transaction
  */
  async function GenerateNet(){
      var amt = [200, 500, 700];
      var netNumber = ['aa', 'bb', 'cc'];
      for(var i=0; i &lt; amt.length; i++){
          let netRegistry = await getAssetRegistry('org.demo.invoice.Net');
          let vals = await netRegistry.getAll();
          console.log(vals.length); 
          console.log(vals);
          let newNetting = factory.newResource('org.demo.invoice','Net', netNumber);
          newNetting.totaltransaction = amt[i];
          await nettingRegistry.add(newNetting);
      }
  }
  </code></pre>
  
  <p>I want to see the value of vals.length to be 1,2,3 as the iteration goes on.</p>