webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Async Table Initial Row Insert

    Posted Fri May 12, 2017 06:33 AM

    I have an async table which inserts & deletes rows that are persisted in a database
    .
    My question is - If there are no rows to display the table still shows an initial empty row which I am trying to use to insert data in the usual way, unfortunately this doesn’t work correctly & no row is inserted.

    Normally - when there is at least one row of data - inserts, deletes & updates work as expected BUT the problem arises when the table is initially empty.
    I can overcome this by using the Add Row button to create a new row and insert the data here, but that seems counter intuitive & ugly!

    Any way this is possible?

    Thanks


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: Async Table Initial Row Insert

    Posted Mon May 15, 2017 03:58 PM

    How are you creating the initial empty row?


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 3.  RE: Async Table Initial Row Insert

    Posted Wed May 17, 2017 07:48 AM

    So I discovered that the actual problem is caused by the the web service connector/flow mechanism.

    When the adapter returns no rows from the DB the flow returns an empty document, representing the row, as this has to be in the flows output for it to return any information.

    This is the empty row being shown in the table!

    I use an async command LINK to action a method which inserts new rows but when attempting the same using the row shown, the log just reports that the row is not found

    row not found: __row

    I noted that the row has an index/id of “_row” whereas when I add a new row using the add row button the index shows as “_row_new***” (where *** is a random number).
    This is the provider at before render response

    
    ******************ROW COUNT 1
    ******************ID null
    ******************INDEX -1

    I think that the easiest solution would be to somehow remove the empty initial row from the provider in the before render response so I set the result of the web service & the provider both to null as below.

     
    if (getProvider().getRowIndex() < 0) {
    getWebService().getResult().setResults(null);
    getProvider().setArray(null);
    }

    This gives me a table without the blank row, now I add a row using the add row button and update as normal but get a null pointer when testing the provider for row values.

     getProvider().getValue("field1");

    I understood the provider would be aligned on the row selected as it is normally so maybe setting it to null is wrong but I can’t see how else to set it to empty & not show the empty row

    Any thoughts?

    Thanks


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 4.  RE: Async Table Initial Row Insert

    Posted Wed May 17, 2017 03:04 PM

    Before evaluating the workarounds, lets consider the root cause.

    If the initial empty row has an id of “_row” then that suggests that the expression you have chosen for the rowId of the table content provider is returning an empty string.

    Can you change the flow service to populate the id field of your document with some non-empty value so that row can be uniquely identified?


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 5.  RE: Async Table Initial Row Insert

    Posted Thu May 18, 2017 06:35 AM

    Many thanks Eric
    That was the solution


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS