Other Usages of Context

AwareIM uses the Context not only when rules are executed. It is also used in the following situations:

Queries using dynamic attributes may be invoked either from form operations in the user interface or from rules (see FIND action). When a query is invoked from a form operation the instance of the business object displayed by the form is written into the Context and used if the query refers to the attributes of this object dynamically. If a query is invoked from rules the dynamic attributes are resolved from the Context of the currently executing rule collection – see How Context is Formed.

When documents are generated attribute values referenced by tags inside documents or tags and conditional elements inside reports are resolved from the Context. The following scenarios are possible:

  1. A document with the data source property set to “Determined at Run-time” is generated in the Operation Mode using an operation of the “Create Document” type (see Setting Menu Item Properties) after a user selects one or more instances of the business object on the Query Results screen. In this case selected instances of the business object are written into the Context and used when the document is generated.
  2. A document with the data source determined by some query is generated in the Operation Mode using the operation of the “Create Document” type. In this case the query is run before the document is generated and the instances of a business object found by the query are written into the Context and used when the document is generated.
  3. A document is generated in the Operation Mode by invoking the operation of the “Create Document” type from the form of a business object (see Form Operations). In this case the instance of the business object being displayed by the form is written into the Context and used when the document is generated.
  4. A document with the data source property set to “Determined at Run-time” is generated from rules (for example, when some attribute is being initialized to some document template – see Document Generation). In this case the document uses the Context of the currently executing rule collection.
  5. A document with the data source determined by some query is generated from rules as in the previous scenario. In this case the query is run before the document is generated and a separate Context is formed. This Context contains the results of the query execution as well as any contents of the Context of the currently executing rule collection. The resulting Context is used when the document is generated.
  6. A sub-report is generated as part of the generation of the master report (see Document Generation). In this case a query associated with the sub-report is run first and then a special Context is formed. This Context contains the results of the query and the current instance of the business object in the master report for which the sub-report is generated. (Note that the query associated with the sub-report may use this instance for attributes resolved dynamically). This Context is used when the sub-report is generated.