orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 220 forks source link

Support for auto-incremented sequence field #4162

Open avernet opened 5 years ago

avernet commented 5 years ago

Currently, when using a relational database, for instance MySQL, this can currently be done as follows:

  1. In the database, create a table:
CREATE TABLE my_seq (
    val INT PRIMARY KEY AUTO_INCREMENT NOT NULL
);
  1. In Form Builder, create a database service seq-insert that runs INSERT INTO my_seq VALUES (). Create an action seq-insert that runs the seq-insert service on form creation.
  2. Still in Form Builder, create a database service seq-read that runs SELECT max(val) val FROM my_seq. Create an action seq-read that runs the seq-read service on form creation and populate the field with /response/row/val.

This RFE calls for supporting this out-of-the-box so form authors can simply designate a field as being auto-incremented, without having to create anything at the database level, or having to create services and actions.

avernet commented 5 years ago

+1 from user +1 from customer