Form editable fields from database

Hi,

I have the following challenges to create a BPM task (the data resides on a db):

  1. There is an input where the user types the id to get personal data of an applicant, and hits search (refresh)

  2. The result of this should populate the inputs of a form in the same page

  3. This inputs should now be available for edit (its an intermediary step, if personal data needs to be updated/validated)

What would be the best approach?

The first challenge is to actually get the data from the db and place it on a form instead of a table.
How do to bind one column to an input field value, is this possible? (bind result[n] value #{ … results.result[n].nationalID} )

Second is to get the data from each form filed and bind it to the a jdbc edit ws bean which will be refreshed once the task is complete.

Any suggestion are welcome :slight_smile:

Regards,

  1. Is the output document of the first web service (the get) is the same document type as the input of the second web service (the save)?

  2. If you’re trying not to use a table, that sounds though the first service returns a repeating group. Is that correct? Why don’t you have it so after the search, which just gets a tiny bit of data about each application, you call a second service that returns one fully populated structure? You can do it either way, but this is easier, and possibly lighter on data.

Yes this should be the case having a shared document that maps data from db to and from the form.

I have worked it out using a table datasource. Strangely this is much more flexible then the web service to jdbc adapter.

Once the datasource is defined with a query like(select * from id_data where id=?) you can actually grab the fields (inside the the datasource bean structure) and drag them to the caf form I have set the maximumRows=1. Also moved the refresh add a dummy value to the id value (so it didn’t set a binding error) and this how the first park is worked. BTW the fields were changed to editable labels.

Can you elaborate a bit more on this?

On this second part I created listeners for all the input fields on the form. Also created an action which is responsible for grabbing the data from the listeners and map it to an editable datasource which gets all the fields.

Sorry, I think I might’ve misunderstood your question. Are you going through IS web services, or are you calling the DB directly from CAF? From reading your reply I assume the latter, but I’m just checking!

Yeap I’m using the database connector. But it would had been the same after looking at task comments code I found what I need. The Iterator 8) now I can get scoped variables as long as you’re contained within the iterator area.

For the second point each of the scoped fields has listener from which I get the value and pass it to a second connector (editApplicantInfo). Allot of work to grab the data from each field listener and that’s the only thumb down of this.

Found complete answer with sample here .

Cheers,