Batch XML Documents

 

Documentation home

 

Batch input document 1

Batch tag attributes 1

Forms tag. 2

Batch response documents 2

Short XML response. 2

Long XML response. 2

Error response. 5

 

See also:   The Ebase Xi Batch System, Batch Administration

 

Batch input document

Has the format shown below.

 

<UFSBatchRequest>

<Batch command="xxxx" name="Jons batch" id="nnnnn" debug="yes">

<Forms>

      ...... see below

</Forms>

</Batch>

</UFSBatchRequest>

 

Batch tag attributes

The command attribute is optional and can have values:

 

create

Save the batch in the database but don't run it. (This is the default if no command is supplied).

runSync

run a batch synchronously

runAsync

run a batch asynchronously

createAndRunSync

creates a batch then runs it synchronously

createAndRunAsync

creates a batch then runs it asynchronously

 

 

If command is 'create', then the <Forms> tag is required. This command will create a new batch in the database, but will not execute it. A short batch response is returned.

If command is runSync or runAsync, the id attribute is required. These commands can be used to execute a batch that already exists in the database. A short XML response is returned immediately for runAsync, and a long XML response is returned for runSync when execution of the batch has completed.

If command is createAndRunSync or createAndRunAsync, the <Forms> tag is required. These commands create a new batch in the database and execute it immediately. A short XML response is returned immediately for createAndRunASync, and a long XML response is returned for createAndRunSync when execution of the batch has completed.

 

The name attribute is optional when supplying a new batch. If ommitted, a default of Batch_Dyyyymmdd_Thhmmss is provided.

 

The debug attribute is optional and can be specified with any command and will cause the system to write diagnostic info to the system log.

 

Forms tag

The Forms tag contains any number of forms, each one of which can contain any number of fields and their values, as shown in the following example. The id attribute for each Form must specify the name of a valid Ebase form. The id attribute for each Field must specify the name of a valid field within the specific form. The language attribute for each Form is optional and specifies the language in which that form will be executed, and this affects how the format of input data is interpreted for field types that are language dependent e.g. dates and numeric fields. See The Ebase Xi Batch System for more information on internationalisation considerations.

 

<Forms>

  <Form id="MORTGAGE_APPLICATION" language="EN">

    <Fields>

      <Field id="MORTG_TYPE">

        <Value>DISC</Value>

      </Field>

      <Field id="DISCOUNT_LENGTH">

        <Value>6M</Value>

      </Field>

      ........more fields

    </Fields>

  </Form>

  <Form id="FORM_2">

    <Fields>

      <Field id="FIRST_NAME">

        <Value>Fred</Value>

      </Field>

      <Field id="SECOND_NAME">

        <Value>Smith</Value>

      </Field>

      ........more fields

    </Fields>

  </Form>

  .....more forms

<Forms>

 

Batch response documents

Short XML response

This response is returned for commands create, runAsync and createAndRunAsync.

 

<UFSBatchResponse>

  <Batch name="xxxxxx" id="nnn" status="OK"/>

</UFSBatchResponse>

 

The status attribute can have values 'OK' and 'Error'.

 

Long XML response

This response is returned for commands runSync and createAndRunSync. This is returned when execution of the batch has completed.

 

<UFSBatchResponse>

  <Batch id="nnn" status="OK"/>

    <Forms>

      .. then form responses as per UFSFormResponse

    </Forms>

  </Batch>

</UFSBatchResponse>

 

Within the Forms tag, each form will have its own response. The forms are presented in the same order as the forms in the input XML document. There are six possible responses as shown in the following examples:

 

1. processed successfully....

 

<Forms>

  <Form id="JOB_APPLICATION" status="OK">

    <Pages>

<Page id="PAGE_1" status="OK"></Page>

        <Page id="PAGE_2" status="OK"></Page>

<Page id="PAGE_3" status="OK"></Page>

    </Pages>

    <Final Messages>                         

      <Message>Application 2000307 created successfully</Message>

    </Final Messages>

  </Form>

</Forms>

 

2. processed unsuccessfully - form error. An error occurred when no current page exists i.e. in a before or after event or loading the form.

 

<Forms>

  <Form id="xxxxx" status="System error">

    <Error>error message text</Error>

  </Form>

</Forms>

 

3. processed unsuccessfully - error setting a field value

 

<Forms>

  <Form id="xxxxx" status="Error">

    <Fields>

      <Field id="xxxxx" status="Error">

        <Value>field value</Value>

        <Error>error message text</Error>

      </Field>

    </Fields>

  </Form>

</Forms>

 

4. processed unsuccessfully - page error i.e. an error message issued by a page event or an error somewhere on the page.

 

<Forms>

  <Form id="JOB_APPLICATION" status="ERROR">

    <Pages>       

<Page id="PAGE_1" status="OK"></Page>

      <Page id="PAGE_2" status="ERROR"></Page>

        <Error>Mandatory field POSTCODE not supplied</Error>

      </Page>

      <Page id="PAGE_3" status="NOT_PROCESSED"></Page>

    </Pages>

  </Form>

</Forms>


5. processed unsuccessfully - an error message issued by a field event

 

<Forms>

  <Form id="JOB_APPLICATION" status="ERROR">

    <Pages>       

      <Page id="PAGE_1" status="OK"></Page>

      <Page id="PAGE_2" status="ERROR"></Page>

        <Fields>

          <Field id="POSTCODE">

            <Value></Value>

            <Error>Mandatory field POSTCODE not supplied</Error>

          </Field>

        </Fields>

      </Page>

      <Page id="PAGE_3" status="NOT_PROCESSED"></Page>

    </Pages>

  </Form>

</Forms>

 

6. invalid request. This should not occur

 

<Forms>

  <Error>XML request document is not valid</Error>

</Forms>

 

Error response

This response is returned if the input XML document cannot be parsed or if the request cannot be executed for any reason.

 

<UFSBatchResponse>

  <Error>message</Error>

</UFSBatchResponse>