User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:adminmanual:businessquestions [2020/09/11 15:06]
kinangwede.kihara [A Business Question configuration would be composed of the following attributes:]
en:adminmanual:businessquestions [2021/01/13 17:01] (current)
joebordes
Line 1: Line 1:
 ====== Business Questions ====== ====== Business Questions ======
-===== BUSINESS QUESTION AND MATERIALIZED VIEW ===== 
-  ​ 
- 
-==== There should be inserted some useful actions in the DetailView of each Business Question: ==== 
- 
-  * Test SQL - runs the SQL query against the database and returns a success / no success message. 
-  * Create Materialized View - creates the physical database table, populated with data from the SQL Query defined in the Business Question 
-  * Remove Materialized View - drops the materialized view 
-  * Add Materialized View Workflow - creates two workflows in the Module specified in cbQuestion: one workflow on each save and the other on delete. 
-  * Delete Materialized View Workflow - drops the workflows at the Module specified in Business Question. 
-  * Add and Delete Materialized View cron - creates a scheduled task that will delete and update the materialized view on the defined frequency. You must review that the scheduled task is set and defined correctly. 
- 
-===== Step To Create Business Question ===== 
- 
-  * Open Question Builder, ​ 
-  * Naming the Materialized View  
-  * Select the Module of You want to add Field. ​ 
-  * For this example The Module is Support Ticket. ​ 
-  * Then add the fields needed, tick Materialized View cron and Work Flow 
-  * Execute if no error click search to fetch records 
-  * Put Manual the Unique ID Field for our example is ‘ticketid’. 
-  * The status should be Active. ​ 
-  * Finally Business Question should be created. 
- 
- 
-Question Builder 
- 
-{{:​en:​adminmanual:​question_builder_image.jpg?​direct&​400|}} 
- 
- 
- 
-Test SQL 
- 
-{{:​en:​adminmanual:​test_sql.jpg?​400|}} 
- 
- 
-This is how the Business Question looks 
- 
-{{:​en:​adminmanual:​business_question_.jpg?​400|}} 
- 
- 
-{{:​en:​adminmanual:​business_question_conti_1.jpg?​400|}} 
- 
- 
-{{:​en:​adminmanual:​business_question_conti_2.jpg?​400|}} 
- 
-Business Question Result 
- 
-{{:​en:​adminmanual:​business_question_result.jpg?​400|}} 
- 
-To return to Builder Question 
-  * On Business Question page go to  Action Functionality click Edit Question 
-{{:​en:​adminmanual:​return_to_question_builder.jpg?​400|}} 
- 
- 
  
  
Line 118: Line 63:
  
 Finally, if we are using a custom SQL written manually and that query has an alias on the main module table and/or on the crmentity table, we must indicate the name of those aliases in the corresponding fields in order for the application to know where to modify the query for individual row updates. Finally, if we are using a custom SQL written manually and that query has an alias on the main module table and/or on the crmentity table, we must indicate the name of those aliases in the corresponding fields in order for the application to know where to modify the query for individual row updates.
 +
 +===== File Exports =====
 +
 +Business questions support a "​File"​ type which will generate a CSV dump of the question. This file will be saved in the cache directory and the path to the file returned.
 +
 +The File type has an extended properties syntax that permits us to define the details of the generated CSV file. The complete properties object looks like this:
 +
 +<code JSON>
 +{
 +  "​delimiter":"​single character to use as field separator. defaults to comma",​
 +  "​enclosure":"​single character to enclose strings that contain the delimiter",​
 +  {
 +    "​format":​ {
 +      "​date":"​Y-m-d",​ // format to use for date fields
 +      "​float":​{ ​      // format to use for decimal/​currency fields
 +         "​decimalseparator":"​.", ​
 +         "​grouping":​ ",",​
 +         "​numberdecimals":​ "​4"​
 +      }
 +  },
 +  "​columns":​ [ // definition of the labels of the columns and the format of the field
 +    {
 +      "​label":​ "​l1",​
 +      "​type":​ "​float"​
 +    }
 +  ]
 +}
 +</​code>​
 +
 +So we can define all the details of the CSV file formatting.
 +
 +The column labels are positional. That means that if you want to put a label on the fifth column you must set also the first four.
 +
 ===== Mermaid Graphs ===== ===== Mermaid Graphs =====
  
Line 172: Line 150:
 The only nodes and links that will be styled are those that the record has gone through, all the others will use the default mermaid styling. The only nodes and links that will be styled are those that the record has gone through, all the others will use the default mermaid styling.
  
-If a node has a condition, the business map will be executed, if it passes the "​*styleaccepted"​ will be applied and if not the "​*stylerejected"​. If either of them are empty, or there is no condition the styling rules defined in the "​defaults"​ section will be applied.+If a node has a condition, the business map will be executed, if it passes the "​*styleaccepted"​ will be appliedand if not the "​*stylerejected"​. If either of them are empty, or there is no condition the styling rules defined in the "​defaults"​ section will be applied.
  
 The node and link MUST appear in the definition section or they will not be styled. The node and link MUST appear in the definition section or they will not be styled.
Line 355: Line 333:
 {{:​en:​adminmanual:​cbmermaid04.png|}} {{:​en:​adminmanual:​cbmermaid04.png|}}
  
-and this is how it looks on a potential record ​which has not followed the defined steps:+and this is how it looks on a potential record ​that has not followed the defined steps:
  
 {{:​en:​adminmanual:​cbmermaid03.png|}} {{:​en:​adminmanual:​cbmermaid03.png|}}