Advanced functions in mapping

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Document Templates > Advanced topics in document templates >

Advanced functions in mapping

It is very common to include in a template a collection that needs to be filtered, as well as a field that requires to display today's date or a reference to a case's information.

 

You can include this information using the advanced functions found in the mapping control in the Configuration Wizard.

 

To access the advanced functions expand the mapping control of the Configuration Wizard as displayed in the image below.

 

DocumentTemplates45

 

The advanced functions are found in the tools icon on the right, as displayed below.

There are six functions that you can use while mapping your attributes to the Template's tags:

Case Info: includes the Case Id and the Case number

Today Date: returns today's date

Collection Filter: opens the collection filter feature to filter the records needed in the document.

Collection Sort: allows sort tables records based on a specific column.

Process Attributes: If Process Attributes have been created, this option is enabled to allow their mapping.

Task Attributes: If Task Attributes have been created, this option is enabled to allow their mapping.

 

To restore the window to its original size click on the icon on the upper right corner.

 

DocumentTemplates46

 

Include today's date

1. Display the advanced functions and drag and drop the function Today date between the two tables.

 

DocumentTemplates47

 

 

2. A new window will display where you can select the format, that is, how you want the date to be displayed in the document. Click OK when you have selected a format.

 

DocumentTemplates48

 

 

3. Map the function with the TemplateĀ“s tag where the date should be saved.

 

DocumentTemplates49

 

4. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

Include Format Number

1. Display the advanced functions and drag and drop the function Format Number between the two tables.

 

DocumentTemplates129

 

 

2. A new window will display where you can select the format, that is, how you want the number to be displayed in the document. Click OK when you have selected a format.

 

DocumentTemplates130

 

 

3. Map the function with the data model's attribute to be formatted and with Template's tag where the date should be saved.

 

DocumentTemplates131

 

4. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

Include a filtered collection

1. Display the advanced functions and drag and drop the function Collection Filter  between the two tables.

 

DocumentTemplates50

 

 

2. Map the function with the data model's attribute where the collection is saved.

This will display the collection filter where you can include the conditions to filter the records. Click Ok when the filter is included.

 

DocumentTemplates51

 

3. Map the function to the Template's tag where the collection is.

Note that the collection is mapped from the data model to the tag but with a function in the middle that will filter the records of the existing table.

 

DocumentTemplates52

 

4. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

 

Include case's information

1. Display the advanced functions and drag and drop the function Case Info between the two tables.

 

DocumentTemplates53

 

 

2. Map the function desired with the Template's tag where the case's information should be saved.

 

DocumentTemplates54

 

3. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

 

Include process or task attributes

1. Display the advanced functions and drag and drop the function Process attributes or Task attributes (as your need) between the two tables. Remember these options will only appear if you have already defined process or task attributes.

 

DocumentTemplates95

 

2. From the new table, map the desired attribute with the Template's tag where the information should be saved.

 

DocumentTemplates96

 

3. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

Sort a collection by a specific column

1. Display the advanced functions and drag and drop the function Collection sort between the two tables.

 

DocumentTemplates125

 

2. Map the function with the data model's attribute where the collection is saved.

This will display an Xpath window where  you can chose the sort by attribute and the sort type (ascending or descending). Click Ok.

 

DocumentTemplates126

 

3. Map the function to the Template's tag where the collection is.

Note that the collection is mapped from the data model to the tag but with a function in the middle that will sort the records of the existing table.

 

 

DocumentTemplates127

 

4. Restore the window to its original size clicking on the icon on the upper right corner and click Finish.

 

 

Delete a function

To delete an advanced functions click over it and type the Del key in your keyboard. All mappings will be lost.