Advanced functions in mapping

<< Click to Display Table of Contents >>

Navigation:  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 eight functions that you can use while mapping your attributes to the Template's tags:

Case Info: includes the Case Id and the Case number

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.

Format Date: defines the format that will display the selected Date-time Xpath attribute.

Format Number: defines the format that will display the selected integer/string  Xpath attribute.

Today Date: returns today's date

 

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.

 

Format a Date

1. This function transforms a date into a string according to the selected format. This function receives a Date input and returns the string with the corresponding formatted date.

 

To use this function, select from the functions (fx) bar, then, drag and drop this option into the main mapping window where your tables are.

 

 

DocumentTemplates133

 

 

2. A new window will display where you can select the desired format within date, time or custom:

 

DocumentTemplates135

 

Control

Enabled Control

Description

Generate output with date.

 

 

By ticking this Check-box, the selected Date-Time Xpath attribute will display: Day, Month and/or Year, depending on the chosen format. You will only be able to select one of the following:

 

 

Default short date format.

 

The date format will display integer characters.

Bizagi sets the Short date format defined on the Business configuration. Bear in mind that if the defined format for the mentioned property is by default, the application will set the format of the Global Culture defined.

Default long date format.

 

The date format will display alphanumeric characters.

Bizagi sets the Long date format defined on the Business configuration. Bear in mind that if the defined format for the mentioned property is by default, the application will set the format of the Global Culture defined.

Another format

 

 

Displays a drop down list to select one format within the most commonly used.

Generate output with time

 

By ticking this Check-box, the the selected Date-Time Xpath attribute will include the time: Hour, Minutes and/or Seconds, depending on the selected format.

 

Time format

Displays a drop down list to select one format within the most commonly used.

Custom format

 

When selected, all other Date and time format options will be disabled

Custom format

This field allows you to add your custom date format.

 

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

 

DocumentTemplates134

 

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

 

Example

The following examples show how to configure Format Date to send from Bizagi some standard formats:

 

1.Date only in format dd/MM/yyyy, i.e for June 24th, 2016, the result will be 24/06/2016.

 

Once the Format Date window is opened, perform the following:

 

Check Generate output with date.

Select Default short date format.

Uncheck Generate output with time.

Click Ok.

 

MappingFunctions09_FormatDate4

 

In the end, the result of the Date box will be:

 

MappingFunctions09_FormatDate5

 

2.Full Date and Time with time zone offset (yyyy-MM-ddtHH:mm:ssz), i.e June 24th, 2016 08:42:05 am in UTC-5, the result will be 2016-06-04a08:42:05-5.

 

Once the Format Date window is opened, perform the following:

 

Copy and paste the format yyyy-MM-ddtHH:mm:ssz in the Custom format combo box

Click on Ok.

 

MappingFunctions09_FormatDate6

 

In the end, the result of the Date box will be:

 

MappingFunctions09_FormatDate7

 

The values presented on the Date box as input, will vary according the values set in the configuration.

 

 

Format a 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

 

This attributes are temporarily used for a short time to store information that is not part of the data model. For more information, refer to the Temporary Attributes article.

 

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.

 

note_pin

Both process and task attributes can only be created from the utilities list of the tags mapping window.

Process attributes: only exist during the process execution.

Task attributes: only exist during the task transaction.

 

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.