BPM Email Task should execute Email template in process context

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hi-ko
    Member
    • May 2015
    • 90

    BPM Email Task should execute Email template in process context

    A bpm email task executes the configured template always in the context of the linked entity. This makes it unhandy to access the process details from the template editor.
    Couldn't we change the context to run the email task to the process since the linked entity is available from the process anyway.
    As a work around I always dump all kind of process info and task outcome into process variables which are then accessable but it would be much more straight forward to have the process entity already in the context of the email template.
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    You are asking for breaking change that will be needed for a small fraction of users. Such breaking changes are not acceptable. It would literally cause problems for many many people.

    > the linked entity is available from the process anyway.

    Not correct. Available, but not to the full extent.

    > it would be much more straight forward to have the process entity already in the context of the email template.

    Completely disagree. Against the design.

    I don't have any idea how process entity could be used in an email (except some notification/logging purpose), but I can come up with many scenarios how the target (and linked entities) could be used in email. All use cases I witnessed were around the target entity (or linked to target), not the process entity.
    Last edited by yuri; 04-04-2023, 06:12 PM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • hi-ko
      Member
      • May 2015
      • 90

      #3
      Hi yuri,

      think of a common use case like an offer review and signoff process for a product description review process.
      Maybe I'm barking up the wrong tree. BPM Workflows I have in mind are focused on a bunch of user tasks (which are sometimes delegated to subprocesses). People involved expect to get notifications about:
      * who completes a task
      * what was the decision (resolution)
      * what was the comment (resolutionNote)

      In case of a system task or for a escalation/exception/event the involved users expect to get notification why and what has been changed.
      All this context is only available in the process and subprocesses.

      So what should be used to send all these notifications containing templated text and maybe links to the submitted user tasks? I thought that's the main use case for the "send message task". Is this a misunderstanding? I think in the message, we only need a link and name to the entity, but not much more.

      Could you please give me an example of a "send message task" which does not focus on the process tasks?

      Very similar requirement in context of worklfows: people want to see a journal, listing all the decisions, comments, status changes with a timestamp and user as a history which could not be modified by any user (inkl. admin). This journal may fit better to be stored on the entity itself.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8453

        #4
        A process around a customer issue (case). Send email to an assigned user about case with case details. Send email to a manager with case details when case is not replied in time.

        The same with lead.

        Process is supposed to be a system entity, with no much details users need to be aware of. Not a business unit.

        Resolution is related to Process User Task entity, not Process. With sub-process, you can switch the target entity to the User Task and then have access to its fields in an email template.
        Last edited by yuri; 04-04-2023, 08:13 PM.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • hi-ko
          Member
          • May 2015
          • 90

          #5
          I would have expected to use what you call workflows (automation by rules) for isssues/cases, not bpm workflows. There you have separate task entities.
          bpm workflows may be more complex and loosly coupled with one or more entities and focused on business processes. processes and cases can complement each other, but in my view they are not the same thing.

          I will give the "switch the target entity" a try.

          Thanks for your feedback.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8453

            #6
            > I would have expected to use what you call workflows (automation by rules) for isssues/cases, not bpm workflows.

            In our docs, all examples are processes around business entity (case, lead etc.). It's how our customers already use it. This tool has been available for years.

            Workflows tool is not suitable for long living processes. Customer support request is one of such examples. You can't visualize it, it will be a set of many rules in a folder that is hard to figure out.

            If your processes are not around any existing entity type, consider creating a custom entity and use it as a central point of your processes.
            Last edited by yuri; 04-05-2023, 05:59 AM.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • hi-ko
              Member
              • May 2015
              • 90

              #7
              I already use a custom entity. The challenge is how to handle user task inputs:
              Send notifications and store inputs from these tasks in the context of the business entity (stream) and also in the following tasks.
              I have ​found my work around by always storing any user task input and decision in separate script tasks in variables named by convention to use these variables in new tasks, formulas, notification templates.
              The examples with user tasks I found so far did not handle the input (resolutionNote, comment) in other tasks, templates or entities.
              Once this is finished I will publish the result here. I hope this will make things easier to understand.
              Thanks

              Comment

              Working...