title: How to Updating Existing Assets? - Hyperledger Composer
body: <p>I am trying to update and Asset in hyperledger, in this case   I am trying to add a new provider to a provider array list in the Asset  but hthe composer dont let me.</p>
  
  <p>I dont know what is wrong.  Belor are the model, the javascript and the error.</p>
  
  <p>Model:</p>
  
  <pre><code>/*
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  namespace org.acme.Bicycle
  
  
  asset Bicycle identified by serial {
    o String serial
    --&gt; Rider owner optional
    --&gt; Rider [] ownerold optional
    --&gt; Provider [] distribuold optional
    --&gt; Store [] Storeold optional
    --&gt; Manufacturing manufacturing
  }
  
  abstract participant User identified by email {
    o String email
    o String firstName
    o String lastName
  }
  
  
  participant Rider extends User {
  
  }
  
  participant Manufacturing extends User {
  
  }
  
  participant Provider extends User {
  
  }
  
  participant Store extends User {
  
  }
  
  
  participant Police extends User {
  
  }
  
  transaction check {
    o String date
    o String Description
    --&gt; Rider owner
    --&gt; Police police
    --&gt; Bicycle bike
  }
  
  
  transaction fabrictodistri {
      o String Description
      --&gt; Manufacturing manufacturing
      --&gt; Bicycle bike
      --&gt; Provider providerstore
  }
  
  
  
  transaction providertostore {
      o String Description
      --&gt; Bicycle bike
      --&gt; Provider providerstore
      --&gt; Store Storeold
  }
  
  
  transaction storetobiker {
      o String Description
      --&gt; Bicycle bike
      --&gt; Store Storeold
      --&gt; Rider owner
  }
  </code></pre>
  
  <p>Script file: here is all my functions</p>
  
  <pre><code>/**
     * @param {org.acme.Bicycle.check} check
     * @transaction 
  */
  async function check(check) {
    let owner = check.bike.owner.email;
    let  ciclista = check.owner.email;
  
    if(owner != ciclista){
      check.description= "This is not the owner";
      throw new Error('This is not the owner');
    }else{
      check.description= "This is the owner";
      throw new Error('This is not the owner');
    }  
  
  }
  
  
  /**
     * @param {org.acme.Bicycle.fabrictodistri} ftod
     * @transaction 
  */
  async function fabrictodistri(ftod) {
        let bike = ftod.bike;
         bike.distribuold.push(ftod.providerstore);
  
  }
  
  /**
     * @param {org.acme.Bicycle.providertostore} ptosto
     * @transaction 
  */
  async function providertostore(ptosto) {
  
     let bike = ptosto.bike;
     bike.distribuold.push(ptosto.providerstore);
     bike.Storeold.push(ptosto.Storeold);
  
  }
  
  
  /**
     * @param {org.acme.Bicycle.storetobiker} stostobik
     * @transaction 
  */
  async function storetobiker(stostobik) {
  
     let bike = stostobik.bike;
      bike.ownerold.push(stostobik.owner);
      bike.owner = stostobik.owner;  
  
  }
  </code></pre>
  
  <p>Error: "TypeError: Cannot read property 'push' of undefined"</p>
  
  <p><a href="https://i.stack.imgur.com/ZSpq1.png" rel="nofollow noreferrer">Image</a></p>