Qdabra Forms - qRules Command Guide Every qRules command, its parameters and behavior All manuals

Chapter 9 - DBXL

First draft. This chapter has not been reviewed yet and may contain mistakes. Please read it with that in mind, and tell us about anything that does not match what you see.

These commands connect a form to Qdabra DBXL: submit the form, or parts of it, as DBXL documents, save pictures and attachments out to DBXL, repoint DBXL data connections and set their user keys, create assignment (QdFlow) documents, load a stored DBXL document into the form, and manage the processing instructions in which DBXL keeps a document's DocID. Chapter 1 explains the command syntax, dynamic parameter values and where results go; this chapter assumes you know it.

The examples use this main data source:

my:myFields
  my:DocID
  my:Title
  my:Requester
  my:Photos
    my:Photo              (repeating, picture or file attachment field)
  my:Orders
    my:Order              (repeating)
      my:OrderDocID
      my:OrderTitle

and these DBXL web service data connections (query connections, each with its own secondary data source of the same name):

SubmitToDBXL         DBXL SubmitDocument method
SubmitWithKey        DBXL SubmitDocumentWithKey method
GetDocument          DBXL GetDocument method
GetDocumentVersion   DBXL GetDocumentVersion method

9.1 SubmitToDbxl

Submits the form, another data source, or selected nodes to DBXL through a query data connection to DBXL's SubmitDocument, SubmitDocumentWithKey or SubmitDocumentAsUser web method. Use it instead of a plain submit when you need to control the doc type, name, author and description, submit only part of the form, or submit many rows as separate DBXL documents in one step.

Syntax

SubmitToDbxl /submit=<data connection> [/doctype=<doc type>] [/dsname=<data source>] [/docid=<DocID>] [/key=<document key>] [/user=<user>] [/name=<text>] [/author=<text>] [/desc=<text>] [/timeout=<seconds>]
SubmitToDbxl /submit=<data connection> /xpath=<XPath> [/doctypexpath=<relative XPath>] [/docidxpath=<relative XPath>] [/keyxpath=<relative XPath>] [/namexpath=<relative XPath>] [/authorxpath=<relative XPath>] [/descxpath=<relative XPath>] [/resultdocidxpath=<relative XPath>] [/resultrefidxpath=<relative XPath>] [...]
Parameter Required Description
/submit Yes Name of the query (receive) data connection to DBXL's SubmitDocument, SubmitDocumentWithKey or SubmitDocumentAsUser method. The method must match the kind of submit (see Notes).
/doctype No The DBXL doc type to submit to. Needed when the form is not opened from DBXL (for example from SharePoint), or when you submit a data source other than the main one. Default empty.
/dsname No Data source to submit. Omit for the main data source.
/xpath No Submit only the node(s) this XPath selects instead of the whole data source. Each selected node becomes its own DBXL document.
/docid No DocID of an existing DBXL document to update. Ignored when /xpath selects several nodes.
/key No Document key, for the SubmitDocumentWithKey method. Ignored when /xpath selects several nodes.
/user No User name, for the SubmitDocumentAsUser method.
/name No Document name. Default empty.
/author No Document author. Default empty.
/desc No Document description. Default empty.
/timeout No Timeout of the submit connection in seconds, for large documents. Used only when greater than 0.
/doctypexpath No Field holding the doc type. Relative to each /xpath node. Overrides /doctype.
/docidxpath No Field holding the DocID for each document. Relative to each /xpath node, or to the data source root without /xpath. Overrides /docid.
/keyxpath No Field holding the document key for each document. Relative like /docidxpath. Overrides /key.
/namexpath No Field holding the name. Relative to each /xpath node. Overrides /name.
/authorxpath No Field holding the author. Relative to each /xpath node. Overrides /author.
/descxpath No Field holding the description. Relative to each /xpath node. Overrides /desc.
/resultdocidxpath No Field that receives the DocID DBXL returns. Relative to each /xpath node.
/resultrefidxpath No Field that receives the RefID DBXL returns. Relative to each /xpath node.

Result: the DocID of the submitted document. When /xpath is used, Result is empty; use /resultdocidxpath to keep each DocID. Success is false with Did not submit any documents if no DocID came back.

Examples

SubmitToDbxl /submit=SubmitToDBXL /doctype=PurchaseRequest /name-xpath=/my:myFields/my:Title /author-xpath=/my:myFields/my:Requester /resultxpath=/my:myFields/my:DocID
SubmitToDbxl /submit=SubmitToDBXL /doctype=Order /xpath=/my:myFields/my:Orders/my:Order /namexpath=my:OrderTitle /docidxpath=my:OrderDocID /resultdocidxpath=my:OrderDocID
SubmitToDbxl /submit=SubmitWithKey /doctype=PurchaseRequest /key-xpath=/my:myFields/my:DocKey

The first submits the whole form as a PurchaseRequest document and writes the new DocID into DocID. The second submits every order row as its own Order document; a row that already has an OrderDocID updates that document, and a new row receives its DocID. The third submits with a document key taken from a field (shown here as my:DocKey; never type a real key into the rule).

Notes

Related: SaveToDbxl, RemoveDbxlPi, SwapDomWithDocument.

9.2 SaveToDbxl

Saves pictures or file attachments out of the form into DBXL, one QdFile document per file, and replaces each field's content with a link to the saved file. Use it to keep large files out of the form data.

Syntax

SaveToDbxl /submit=<data connection> /xpath=<XPath> [/dsname=<data source>] [/autoopen=true] [/domainid=<domain ID>] [/qdimage=true]
Parameter Required Description
/submit Yes Name of the DBXL SubmitDocument data connection.
/xpath Yes The picture or file attachment field(s) to save. Every selected field that has a value is saved.
/dsname No Data source of the fields. Omit for the main data source.
/autoopen No true writes links that open the saved file itself rather than the DBXL document that stores it. Default false.
/domainid No A DBXL domain to associate with each saved file.
/qdimage No true also tries to create a QdImage document for each file (see Notes). Default false.

Result: the number of files saved. Success is false if no file was saved (for example when every selected field is empty).

Example

SaveToDbxl /submit=SubmitToDBXL /xpath=/my:myFields/my:Photos/my:Photo /autoopen=true

Saves every photo in the table to DBXL, clears each field and leaves a link that opens the picture.

Notes

Related: SubmitToDbxl.

9.3 AdjustDbxlConnections

Repoints every DBXL data connection in the form to another DBXL server, and sets the user key of every user-key-based DBXL connection. Use it on QdabraRules > finishedLoading so that one template works against development, test and production DBXL servers, and so that no user key is stored in the template.

Syntax

AdjustDbxlConnections [/url=<DBXL base URL> | /useurlvariable=true] [/key=<user key> | /usekeyvariable=true]
Parameter Required Description
/url No DBXL base URL, for example https://dbxl.mycompany.com/QdabraWebService. If omitted, the value of the environment variable DbxlUrl is used when it exists.
/key No A DBXL user key. If omitted, the value of the environment variable DbxlUserKey is used when it exists.
/useurlvariable No true uses the DbxlUrl environment variable; if it does not exist, a reference to it ({fvEnvironmentVariable:DbxlUrl}) is written into the connection URLs instead. Default false. Cannot be combined with /url.
/usekeyvariable No true writes a reference to the DbxlUserKey environment variable ({fvEnvironmentVariable:DbxlUserKey}) into the key fields instead of a key value. Default false. Cannot be combined with /key.

Result: the number of DBXL connections that were changed.

Examples

AdjustDbxlConnections
AdjustDbxlConnections /usekeyvariable=true
AdjustDbxlConnections /url=https://dbxl-test.mycompany.com/QdabraWebService

The first takes both the URL and the user key from the DbxlUrl and DbxlUserKey environment variables, which is the recommended setup. The second puts a reference to the DbxlUserKey variable into the key fields instead of the key itself. The third only repoints the connections. Avoid typing a key into the command itself (/key=<user key>): the rule text is stored in the template, where anyone with the template can read it.

Notes

Related: SubmitToDbxl, SwapDomWithDocument.

9.4 AssignDocument

Creates a QdFlow assignment document in DBXL (doc type QdEmailFlow) for an existing DBXL document: who it is assigned to, its status, a comment and optional CC recipients. The command description states that it requires DBXL 2.4, and that /email and /ccEmail require DBXL 2.5 or later.

Syntax

AssignDocument /submit=<data connection> /docid=<DocID> /alias=<alias> [/name=<name>] [/email=<address>] [/status=<text>] [/comment=<text>] [/cc=<alias;alias...>] [/ccEmail=<address;address...>] [/myinfo=<data connection>]
Parameter Required Description
/submit Yes Name of the DBXL SubmitDocument data connection.
/docid Yes DocID of the document being assigned (the host document).
/alias Yes Alias of the person the document is assigned to.
/name No Name of that person. Default: the /alias value.
/email No E-mail address of that person.
/status No Status text. Default empty.
/comment No Comment. Also used as the description of the QdFlow document. Default empty.
/cc No Semicolon-separated list of CC aliases.
/ccEmail No Semicolon-separated list of CC e-mail addresses, in the same order as /cc. Note the capital E: the parameter must be written exactly /ccEmail.
/myinfo No Name of a data connection to DBXL's GetMyInfo service (see Notes).

Result: the DocID of the new QdFlow document. Success is false with Unable to determine docid of submitted document. if DBXL does not return one.

Example

AssignDocument /submit=SubmitToDBXL /docid-xpath=/my:myFields/my:DocID /alias=jsmith /name=Jane Smith /[email protected] /status=Assigned /comment=Please review

Assigns the document whose DocID is in DocID to Jane Smith with status Assigned.

Notes

Related: SubmitToDbxl.

9.5 SwapDomWithDocument

Loads a document stored in DBXL into the open form: it runs a GetDocument (or GetDocumentVersion) connection for a DocID and replaces the main data source's content with the retrieved XML. Use it to open another DBXL document, or an earlier version of it, without leaving the form.

Syntax

SwapDomWithDocument /getdocument=<data connection> /docid=<DocID> [/version=<version>] [/upgradedocument=true]
Parameter Required Description
/getdocument Yes Name of the DBXL GetDocument data connection, or a GetDocumentVersion connection when /version is used.
/docid Yes DocID of the document to load. Must be a number.
/version No Version of the document to load. Requires a GetDocumentVersion connection.
/upgradedocument No true runs the template's upgrade transform on the retrieved document before loading it. Default false.

Result: empty on success.

Examples

SwapDomWithDocument /getdocument=GetDocument /docid-xpath=/my:myFields/my:DocID
SwapDomWithDocument /getdocument=GetDocumentVersion /docid=1042 /version=3 /upgradedocument=true

The first loads the document whose DocID is in DocID. The second loads version 3 of document 1042 and upgrades it to the current template.

Notes

Related: SubmitToDbxl, RemoveDbxlPi.

9.6 RemoveDbxlPi

Removes the QdabraDBXL processing instruction, in which DBXL and SubmitToDbxl keep the document's DocID, doc type, name, author and description. Use it before SubmitToDbxl to save the form as a new DBXL document instead of updating the one it came from (for example a "Copy as new" button).

Syntax

RemoveDbxlPi [/dsname=<data source>]
Parameter Required Description
/dsname No Data source to remove it from. Omit for the main data source.

Result: empty on success. Success is false with The specified processing instruction was not found. if the data source has no QdabraDBXL processing instruction.

Example

RemoveDbxlPi

Notes

Related: SubmitToDbxl, RemovePi, InsertPi.

9.7 InsertPi

Adds a processing instruction to the top of a data source, before its root element, or replaces one that already exists.

Syntax

InsertPi /name=<PI name> /data=<text> [/update=true] [/dsname=<data source>]
Parameter Required Description
/name Yes Name (target) of the processing instruction.
/data Yes Content of the processing instruction.
/update No true replaces a processing instruction with the same name if there is one. Default false: the command fails instead.
/dsname No Data source. Omit for the main data source.

Result: empty on success.

Example

InsertPi /name=QdabraDBXL /data=docid="1042" /update=true

Points the form at DBXL document 1042, so that a following SubmitToDbxl updates that document.

Notes

Related: RemovePi, RemoveDbxlPi.

9.8 RemovePi

Removes a processing instruction, by name, from the main data source.

Syntax

RemovePi /name=<PI name>
Parameter Required Description
/name Yes Name (target) of the processing instruction to remove.

Result: empty on success. Success is false with The specified processing instruction was not found. if there is none with that name.

Example

RemovePi /name=QdabraDBXL

Does the same as RemoveDbxlPi for the main data source.

Notes

Related: InsertPi, RemoveDbxlPi.

Back to the Command Index.

© Qdabra Software  |  Questions and corrections: [email protected]  |  Preview copy, not linked from the public site.