Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For the newest documentation on the pending queue and APIs offered by the Web Platform click here

non-deterministic initialisation

...

As such, for custom JavaScript that executes during BIC initialisation, the following somewhat-cumbersome ritual is required:

Code Block
languagejs
require(['jquery', 'bic'], function ($) {
  $(document).one('pagebeforeload', function () {
    $.when(BMP.BIC.pending.initialize).then(function () {

      /* here your code can safely manipulate the pending queue */

    });
  });
});

Just checking the Promise should be all that is necessary for Interaction-specific and Form Behaviour-specific code:

Code Block
languagejs
$.when(BMP.BIC.pending.initialize).then(function () {

  /* here your Interaction code can safely manipulate the pending queue */

});

Data Model

Whilst the APIs may be used to persist other types of structured data, the only supported data of interest here are records used with our Forms libraries and services.

...

Asynchronously stores a new model in the pending queue. A unique UUID will be assigned to that entry in the pending queue while it is being stored.

Code Block
languagejs
var pendingRecord = BMP.BIC.pending.create({ /* see Data Model */ });
pendingRecord.once('change', function () {
  // pendingRecord.id is now available, indicating that the record is saved
});


BMP.BIC.pending.processQueue = function ()

Processes each PendingItem in the queue. If the status property is Pending, then an attempt will be made to submit the entry to the server. All other values of status cause the PendingItem to be skipped.