SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Creating a new record in a datapool at runtime

    Hi Guys,

    Do you have any ideas/codes that can add a record at the datapool during runtime?

    Thanks a lot.

  2. #2
    Junior Member
    Join Date
    Jul 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Creating a new record in a datapool at runtime

    hi maybe my article will help you about editing datapool at runtime

    http://www.sqablogs.com/MoonOne/1183...onal+Test.html

    since, we want to add a new record into datapool,
    just use 'appendRecord' method of IDatapoolEquivalenceClass

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Creating a new record in a datapool at runtime

    Hi I've actually stumbled down a code from IBM but i keep getting an error an I do not know how to fix it. Heres the code:
    // Datapool creation for editing
    String projectDir = "C:\\sample"
    //(String)getOption(IOptionName.DATASTORE);
    File dpFile = new File(projectDir, "SampleInsert.rftdp");
    IDatapool dp = DatapoolFactory.get().loadForEdit(dpFile, true);

    int defClassIndex = dp.getDefaultEquivalenceClassIndex();
    DatapoolEquivalenceClass dpc = (DatapoolEquivalenceClass)dp.getEquivalenceClass(d efClassIndex);

    // add as many record as you wish.
    // two records are being added here
    for(int i=0; i<2; i++)
    {
    IDatapoolRecord rec=dpc.constructRecord(null);
    int index = dp.getVariableIndex("emp_id");
    ((IDatapoolCell)rec.getCell(index)).setCellValue(" emp_id" + i);
    index = dp.getVariableIndex("email");
    ((IDatapoolCell)rec.getCell(index)).setCellValue(" email" + i);
    dpc.appendRecord(rec);
    }
    ((org.eclipse.hyades.edit.datapool.IDatapool) dp).appendEquivalenceClass(dpc);

    //Saving the datapool
    DatapoolFactory.get().save((org.eclipse.hyades.edi t.datapool.IDatapool) dp);
    DatapoolFactory.get().unload(dp);


    And here's my error:
    org.eclipse.hyades.execution.runtime.datapool.Data poolException: CRFCN0500E: Invalid cell specification -1 in getCell.

    Hope you can help me in editing the code to make it work

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:06 PM.

Copyright BetaSoft Inc.