Understanding Process Elements and Process Configuration Elements |
![]() ![]() ![]() |
This section aims to show the whole picture of Process Elements on the Page XSL Style Sheet and Process Configuration Elements on the Page Configuration File and their connections using an example. Definitions of the Process Elements in the Page XSL Style Sheet
The code snippet of the ProcessForm and other nested Process based elements in the Page XSL Style Sheet:
Process Form In the above HTML code, by attaching mo: attributes a standard HTML form is marked as a Process Form. The name of the Process Form is "CustomersForm". There is one Process Block element nested in it. See more on ProcessForm Process Block Any HTML element which may contain nested elements can be designated as a Process Block with type="ProcessBlock" attribute. In the example a table element is chosen for that. A Process Block may have 0 or more Process Records. See more on ProcessBlock Process Record In the example, the tr element of the table is marked as Process Record. With the value of its mo:blockId attribute the process records are linked to their process blocks. The code in the example above is actually a part of an XSL stye sheet and the repetition of the code that starts with For each /root/customers/item node existing in the Page XML Data a Process Record is constructed in the output HMTL. Process Fields A Process Record may contain 0 or more Process Fields. There are many different types of Process Fields such as EditBox, ComboBox, HiddenBox, DateDialog, SuggestBox, etc. A Process Field wraps one or more HTML elements and acts one single user control. If an HTML element has mo:field="true" definition that it is a Process Field element. In the example above there are two Process Fields which are NAME and ID. Note that the HTML elements that are designated as Process Fields must have "pf_" prefixes in their names. e.g. pf_NAME and pf_ID. The Selection Box To give the users possibility to select one or more records before submitting the Process Form a Selection Box must be provided inside the Process Records using the following code.
The Record Status Field Additionally, there must be a hidden input element in the Process Record to keep the status information about the enclosing record.
Using the information provided by this field the Process Manager knows if the record is selected and/or modified and even the names of the fields that were modified by the user. To access the information provided by this field _selected, _modified symbols and ismodified() function can be used in MScript codes. See more on ProcessRecord Process Command To submit a Process Form at least one Process Command must exist in the Process Form. A Process Command can be defined on any form input element. In the example a <input type="button" /> element is used. The form submission is realized with PMgr.submitProcessForm() Javascript call. This function call can be triggered from anywhere in the page. See more on ProcessCommand Appearance On Browser When the Page XSL Style Sheet is transformed into HTML at the runtime, the Process Form and its nested elements are displayed as follows on the browser. Here the user can modify the value of "NAME" field and select Process Records by means of checking the check boxes. When the user clicks on the Submit button, the Process Form is submitted to the "ProcessManager.doms" URL. For each Process Command element defined in the Page XSL Style Sheet, there must be an accompanying processCommand configuration element in the Page Configuration File. The name attribute of the processCommand element should consist of the name of the Process Form and the name of the Process Command. Process Configuration: The configuration consists of a processCommand, a processTemplate and two process elements. When Process Form "CustomersForm" is submitted with command "PrintOrders" by clicking on the command button the form is submitted to the "ProcessManager.doms" service. The Process Manager starts by accessing to the processCommand configuration "CustomersForm.PrintOrders". Afterwards the Process Manager finds the processTemplate configuration "PrintOrders" addressed by the Process Command. The first element in the processTemplate is a callQueryProcess definition which says call "GetOrders" process for each selected record in the Process Block "CustomerBlock". In the "CustomersBlock" there are four records but only two of them are selected by the user which are "2" and "4". Since the recordFilter of the call definition is "_selected" the Process Manager calls the processRecord() method of the "GetOrders" process only for records "2" and "4". "GetOrders" is a query process and is expected to generate 0 or more result records for each input record given to it. Before calling the processRecord() method of the QueryProcess class for each record that satisfies the precondition defined with recordFilter, the Process Manager calls the prepare() method of it and lets it initialize prior to successive processRecord() calls. The process configuration element configures the RelDBQueryProcess. The objective of this process is to execute the SQL query given with SQL parameter for each input record and create result records out of the query results. Since the MScript functions existing in the SQL parameter is resolved before the query execution, each time a different query is executed and different number of result records are achieved. The "PrintOrder" process which is configured with nested call definition element is called two times for customer "2" since it has two orders and one time for customer "4" since it has one order.
|