Task manager
CMDBuild allows you to configure automatic operations executed in background by a Task Manager integrated in the system.
The Task Manager groups the management of such operations. In this way you can have a general view on the active tasks and on the execution parameters.
The types of available tasks are:
- Inbox: control the e-mail inbox, file emails into the system together with any attachments, notify their incoming and start a workflow
- Send email: also with attached report
- Scheduling of Import / Export files: based on file template
- Scheduling of Import from database: based on database template
- Scheduling of Import GIS: based on GIS template
- Scheduling of IFC Import: based on IFC template
- Scheduling workflow: automatic start of a workflow

There is the possibility of performing the following operations:
- Configure a new task
- Search a task in the list
- Run a single task
- Start a task
- Stop the execution of a task
- Expand the current row and display the task data
- Edit the selected task
- Display the complete information related to the selected task
- Clone the selected task
- Delete the selected task
The current configuration of the Task Manager is filed in the DB and every time CMDBuild restarts the active tasks are automatically restarted.
Below an example of list and task detail.


For each task typology there is a specific wizard that supports its configuration. It is described in detail in the following paragraphs.
Task inbox management
The task for the email incoming waits for the emails to be filed into a specific IMAP folder of a certain account, verifies if it coincides with any prearranged filter criteria and carries out the recommended instructions.
Such activities include also:
- Sending notifications
- Saving attachments in Alfresco
- Starting workflows
For example you can start this function in order to start Incident Management processes when you receive an e-mail from users, you can also manage any replies from users in a following step of the same workflow, etc.
The wizard includes four pages described below.
Page 1 of the wizard
The following information is required:
- Name: Task name
- Description: Task description
- Account: Post account to control the incoming e-mails (see chapter related to the Email management)
- Inbox: IMAP folder to control the incoming e-mails

Page 2 of the wizard
The following information is required:
-
Type of filter, which can be:
- None
- Regex: filter with regular expression, you can assemble it following our guide
- PostgreSQL function: function defined in the database, with a selection list
- This is a reply to an email sent from CMDBuild: in order to link it to the card related to the initial mail
- This is not a reply to an email sent from CMDBuild
-
Filter on sender: it includes a possible Regex filter set on the e-mail sender in order to exclude less interested e-mails; it is expressed as regular expression and can be set through a proper pop-up window
-
Filter on the subject: It includes any Regex filter set on the subject of the e-mail in order to exclude less interested e-mail; it is expressed as regular expression and can be set through a proper pop-up window
-
Function: It allows to select the PostgreSQL function that implements the filter, in case this option has been chosen
-
Processed e-mails: IMAP folder for processed e-mails
-
Move any emails that do not satisfy the filter: Flag that required the relocation of the emails discarded by the filter
-
Discarded e-mails: IMAP folder for discarded e-mails
-
Advanced answer recognition: Uses "tags" in the header of the mail to obtain useful info and link input email to output ones and to the related data cards

Page 3 of the wizard
The information related to the scheduling ways of the task is required:
- Simple mode: With the options "every hour", "every day", "every month", "every year"
- Advanced mode: With the same options and the same syntax as the schedule tool "cron" available in Linux

Page 4 of the wizard
The following information is required:
- E-mail body parsing: It enables the email body parsing
- Key start delimiter: It allows to specify the initial delimiter of the possible key field available in the e-mail
- Key final delimiter: It allows to specify the final delimiter of the possible key field available in the e-mail
- Value start delimiter: It allows to specify the initial delimiter value field available in the e-mail
- Value end delimiter: It allows to specify the final delimiter of the value filed available in the e-mail
- Attachment filing into DMS: It enables the attachment filing into DMS
- Action on attachments: Any file attached in the email can be linked to the email card in CMDBuild, or to the data card
- Category: It requires to select the category that should be associated with the attachment (all the entries of all the documental categories are available)
- Import GIS attachment: Enables importation of the DWG attachment file, if present
- GIS template: Allows to select the GIS Template you want to use

Note:
The "Body parsing" mechanism allows you to recognize and manage in the workflow any attributes whose value was inserted in the e-mail body, for example:
Email body
[key]Requester[/key]<value>John Smith</value>
[key]Description[/key]<value>The printer will not turn on</value>
[key]Priority[/key]<value>Medium</value>
Page 5 of the wizard
The following information is required:
- Start process: It enables the process starting
- Process: Name of the starting process (chosen in the list of available processes)
- Advance workflow: The process can be advanced to the following step
- Attachment filing into DMS: It enables the attachment filing into DMS, linked to the process
- Category: It requires to select the category that should be associated with the attachment (all the entries of all the documental categories are available, if configured for the selected process)
- Mapping of fields: Indication of the email fields that have to be reported in the starting process

Page 6 of the wizard
The following information is required:
- Send notification email: it enables the notification sending
- Email template: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)

Send email task
This function allows you to schedule the automatic and recurring sending of an email, with the option to attach a report. You can predefine the value criteria of the report parameters, obtaining in this way the sending of reports which depend on the time of the task execution. The wizard includes three pages, described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description

Wizard page 2
The following information is required:
- Account: email recipient
- Template email: you can use this template when you send email (see chapter related to the email management)
- Email variables: you can define context variables, which can be used for the calculation of the report parameters
- Attached report: it enables a report attached to the email
- Report: allows to select the report to send
- Format: allows to specify the format of the report, choosing from the provided ones
- Report parameters: the system presents the list of parameters provided by the selected report and allows compilation

Wizard page 3
The information related to the scheduling ways of the task is required:
- Simple mode: with the options "every hour", "every day", "every month", "every year"
- Advanced mode: with the same options and the same syntax as the schedule tool "cron" available in Linux

Task import / export scheduling by file
The task allows you to execute data import or export operations in batch mode through file, using specific templates described in the related chapter. The wizard includes four pages described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description
- Type: import or export
- Template: choice of import / export template

Page 2 of the wizard
The following information is required:
- Source: File in the server or URL In case the source is a file in the server, the following information is required:
- Directory: server or shared folder including the file
- File pattern: name or pattern for the file recognition
- Post import action: it deletes or disables the file (it is renamed with a predefined pattern) or move the file (in this case the new folder is required) or no action

Page 3 of the wizard
The information related to the scheduling ways of the task is required:
- Simple mode: with the options "every hour", "every day", "every month", "every year"
- Advanced mode: with the same options and the same syntax as the schedule tool "cron" available in Linux

Page 4 of the wizard
The following information is required:
- Notification mode: in case of errors or always or never In the first two cases the following information is required:
- Execution email template: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Template email of error notification: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Account: it requires to select one of the accounts preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Attach report: requests to attach the report, actions and possible errors to the mail

Task import scheduling by database charts
The task allows you to execute data import or export operations in batch mode from relation database charts, using specific database templates described in the related chapter of this manual. The wizard includes four pages described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description

Page 2 of the wizard
The following information is required:
- Database template: choice of the import database template to apply
- Address: connection string to the external database (the one set in the template can be kept as default)
- Username: access username to the external database (the one set in the template can be kept as default)
- Password: access password to the external database (the one set in the template can be kept as default)

Page 3 of the wizard
The information related to the scheduling ways of the task is required:
- Simple mode: with the options “every hour”, “every day”, “every month”, “every year”
- Advanced mode: with the same options and the same syntax as the schedule tool “cron”

Wizard page 4
The following information is required:
- Notification mode: in case of errors or always or never In the first two cases the following information is required:\
- Execution email template: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Template email of error notification: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Account: it requires to select one of the accounts preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Attach report: requests to attach the report, actions and possible errors to the mail

Task import scheduling by GIS planimetries
The task allows you to execute data import or export operations in batch mode from GIS planimetries, using specific database templates described in the related chapter of this manual.
The wizard includes four pages described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description

Page 2 of the wizard
The following information is required:
- GIS template: choice of the GIS import template to apply
- Source: File in the server or URL
- Directory: server folder where you can find the DWG file to import
- File pattern: name or pattern for the DWG file recognition
- Post import action: it deletes or disables the file (it is renamed with a predefined pattern) or move the file (in this case the new folder is required) or no action

Wizard page 3
The information related to the scheduling ways of the task is required:
- Simple mode: with the options “every hour”, “every day”, “every month”, “every year”
- Advanced mode: with the same options and the same syntax as the schedule tool “cron” available in Linux

Wizard page 4
The following information is required:
- Notification mode: in case of errors or always or never In the first two cases the following information is required:
- Execution email template: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Template email of error notification: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Account: it requires to select one of the accounts preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Attach report: requests to attach the report, actions and possible errors to the mail

Task import scheduling by IFC file (BIM models)
The task allows you to execute data import or export operations in batch mode from IFC exchange files (format to export 3D BIM models), using specific database templates described in the related chapter of this manual.
The wizard includes four pages described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description

Page 2 of the wizard
The following information is required:
- BIM template: choice of the import template to apply
- Import from: provides "File" or "Project" options In case you import from a file, the following information is required:
- Directory: server or shared folder including the file
- File pattern: name or pattern for the file recognition
- Post import action: it deletes or disables the file (it is renamed with a predefined pattern) or move the file (in this case the new folder is required) or no action In case you import from a project, the following information is required:
- Project name: for a description of BIM In both cases you need:
- Association mode: automatic or static

Wizard page 3
The information related to the scheduling ways of the task is required:
- Simple mode: with the options “every hour”, “every day”, “every month”, “every year”
- Advanced mode: with the same options and the same syntax as the schedule tool “cron” available in Linux

Wizard page 4
The following information is required:
- Notification mode: in case of errors or always or never In the first two cases the following information is required:
- Execution email template: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Template email of error notification: it requires to select one of the templates preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Account: it requires to select one of the accounts preconfigured with the proper function (see chapter relate to the e-mail management menu)
- Attach report: requests to attach the report, actions and possible errors to the mail

Scheduling task for starting workflow
This task allows you to schedule a workflow configured in CMDBuild.
The wizard includes two pages described below.
Page 1 of the wizard
The following information is required:
- Name: task name
- Description: task description
- Process: starting workflow
- Job username: to be used to start the workflow (from which permissions derive, according to the predefined group)
- Process attributes: list of attributes and values to initialize some starting process attributes

Page 2 of the wizard
The information related to the scheduling ways of the task is required:
- Simple mode: with the options “every hour”, “every day”, “every month”, “every year”
- Advanced mode: with the same options and the same syntax as the schedule tool “cron” available in Linux
