How to find Process Definitions Associated Process Email Templates

Dear All,

We want to find out Process Email Templates used in each BPM, can you please suggest best way to find Process Definitions Associated Process Email Templates.

Thanks,

Shreya

Parents
  • Hello 

    From the Sugar graphic interface, you'll need to navigate to the Designer of your Process Definition and open the settings of each Message event to see the related Process Email Template name. 

    If you have access to the Database I believe you can list all the Process Email Templates related to a given Process Definition ID with the following query: 

    SELECT def.prj_id as ProcessDefinitionID,def.evn_criteria as EmailTemplateID ,templ.name as EmailTemplateName
    FROM pmse_bpm_event_definition def, pmse_emails_templates templ
    WHERE def.prj_id='<ProcessDefinitionID>'
    AND def.evn_criteria=templ.id;


    Can you give it a try and let me know if this works for you? 

    I hope this helps. 

  • Dear ,

    Thanks for the response, I m trying to get process definition name, please check below query:

    SELECT def.pro_id as ProcessDefinitionID,pmse_project.name as ProcessDefinitionName,def.evn_criteria as EmailTemplateID ,templ.name as EmailTemplateName
    FROM pmse_project
    LEFT JOIN pmse_bpm_event_definition def
    ON def.pro_id = pmse_project.id
    LEFT JOIN pmse_emails_templates templ
    ON templ.id = def.evn_criteria
    WHERE pmse_project.prj_status = 'ACTIVE' AND pmse_project.deleted = 0;

    Above query is not working...

    Thanks,

    Andre

  • Hello 

    There was a typo on my query that you copied into yours, on the Select it should be def.prj_id instead of def.pro_id.

    I corrected it and added a line to exclude rows with empty template names. Let me know if this works for you. 

    SELECT def.prj_id as ProcessDefinitionID,pmse_project.name 
    as ProcessDefinitionName,def.evn_criteria as EmailTemplateID ,
    templ.name as EmailTemplateName FROM pmse_project 
    LEFT JOIN pmse_bpm_event_definition def 
    ON def.prj_id = pmse_project.id 
    LEFT JOIN pmse_emails_templates templ 
    ON templ.id = def.evn_criteria 
    WHERE pmse_project.prj_status = 'ACTIVE' 
    AND pmse_project.deleted = 0
    AND templ.name IS NOT NULL;


  • Dear Andre,

    If I run above query then it's not fetching all process definitions email template even though 

    pmse_project.prj_status = 'ACTIVE'.

    Can you please check.

    Is "pmse_bpm_event_definition" table contains entries for process definitions events which are triggered?

    Thanks,

    Shrey 

  • Hello 

    Can you provide me with an example of a process definition email template that is not being fetched? Is it by chance part of an out-of-box pre defined Process? 


  • Just verify if you are getting email templates for all records in pmse_project with condition pmse_project.prj_status = 'ACTIVE' and has send message event  in that  process definitions. 

    To reproduce the issue:

    Create 2 process definitions and add send event

    Trigger first process definition only

    Then and execute below query.

    THanks,

    Shreya

  • The pmse_bpm_event_definition will contain the information of the email template in the column evn_criteria as you can see here:

    https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_12.0/Architecture/SugarBPM/

    I am being able to return all the custom Processes and Email templates with the following query (triggered or not triggered)

    SELECT def.prj_id as ProcessDefinitionID, 
    def.evn_criteria as EmailTemplateID, 
    templ.name as EmailTemplateName,
    proj.name as ProcessName 
    FROM pmse_bpm_event_definition def 
    LEFT JOIN pmse_emails_templates templ
    ON def.evn_criteria = templ.id 
    LEFT JOIN pmse_project proj 
    ON def.prj_id = proj.id
    WHERE templ.name IS NOT NULL;



    Only the out-of-the-box processes are not being caught as the pmse_bpm_event_definition > prj_id does not find a match in the pmse_projects table. 

    Can you let me know if the results for you are the same? 


  • Hi Andre,

    Yes right, now above query is working to get all email templates, but if I export the result and if process name is column is  blank and if I try to open process definition using "ProcessDefinitionID" column then it gives error of "

    Data not available

    Page does not exist or you do not have permission to access this page.

    Please try again. If the error persists, please contact your Sugar Administrator.

    "

    even thought I have admin rights.

    Please suggest..

    Thanks,

    Shreya

Reply
  • Hi Andre,

    Yes right, now above query is working to get all email templates, but if I export the result and if process name is column is  blank and if I try to open process definition using "ProcessDefinitionID" column then it gives error of "

    Data not available

    Page does not exist or you do not have permission to access this page.

    Please try again. If the error persists, please contact your Sugar Administrator.

    "

    even thought I have admin rights.

    Please suggest..

    Thanks,

    Shreya

Children
No Data