Announcement

Collapse
No announcement yet.

BPM Flowchart Note as Target entity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BPM Flowchart Note as Target entity

    Hi all,
    Is it possible to use Note as a target entity of a Flowchart or is it available only in Workflow?
    I know that Note is not on the list of available target entities for a flowchart, but I would like to know if there is any workaround (even if it involves custom code).

    Thank you in advance

  • #2
    Hello,
    The Note entity is available to select in Workflow as a target entity. Please check it.

    Comment


    • murugappan
      murugappan commented
      Editing a comment
      Hi Maximus , if i am not mistaken the question was the "Note" entity available as a target entity when we create a flowchart? I checked and i found its a system entity and is it not selectable as a target entity. If understand correctly, it is used to contain all the notification messages that appear under the notification bell depending on the target audience.

  • #3
    Hi Maximus, as murugappan stated, I need to apply a complex notification logic to the Note entity and it would be really useful to have it as target entity on flowcharts BPM.
    I would like to know if there is any workaround (even if it involves custom code) to make it available in BPM.
    Thank you

    Comment


    • #4
      Hi. Sorry for the delayed reply.
      As far as I remember you need to make some changes in a code and rewrite in the custom folder in a specific file the list of the entities that are ignored by BPM (rewrite the list without Note entity in it). Unfortunately, I don't remember which file you need to rewrite. Also, I don't have the Advanced Pack extension to investigate it and provide you the detailed steps for it.
      Please try to make some investigation. Check the file /application/Espo/Modules/Advanced/Resources/metadata/entityDefs/BpmnFlowchart.json.

      Comment


      • #5
        Hi Maximus , I checked the file /application/Espo/Modules/Advanced/Resources/metadata/entityDefs/BpmnFlowchart.json and found that the ignore list does not contain the Note entity. But, when i check the flowchart target entity, the Note entity is still not selectable. See screencaps for details.

        On further checking, it appears that ignore list for system related entities may have been hard coded (possibly because they are not event-related to create a process trigger??). If my assumption is correct, note is not user triggerable entity.
        Attached Files
        Last edited by murugappan; 08-19-2021, 02:03 PM.

        Comment


        • #6
          Please tell what is your Advanced Pack version?
          Katia, Vadym could you investigate what changes are required to allow the Note entity for BPM?

          Comment


          • murugappan
            murugappan commented
            Editing a comment
            I think mine is outdated.Its 2.5.10. Its in our espocrm simulation environment. Will test it after upgrading.

        • #7
          Hi All,
          Thank you very much for the support.
          The view used for rendering the Target Entity Type dropdown field in BPM Flowchart detail page is this one:
          advanced:views/bpmn-flowchart/fields/entity-type

          Code:
          Espo.define('advanced:views/bpmn-flowchart/fields/entity-type', 'views/fields/enum', function (Dep) {
              return Dep.extend({
                  setupOptions: function () {
                      var scopes = this.getMetadata().get('scopes');            
                      var entityListToIgnore1 = this.getMetadata().get(['entityDefs', 'Workflow', 'entityListToIgnore']) || [];
                      var entityListToIgnore2 = this.getMetadata().get(['entityDefs', 'BpmnFlowchart', 'targetTypeListToIgnore']) || [];
                      this.params.options = Object.keys(scopes).filter(function (scope) {
                          if (~entityListToIgnore1.indexOf(scope)) return;
                          if (~entityListToIgnore2.indexOf(scope)) return;
                          var defs = scopes[scope];
                          return (defs.entity && (defs.object));
                      }).sort(function (v1, v2) {
                          return this.translate(v1, 'scopeNamesPlural').localeCompare(this.translate(v 2, 'scopeNamesPlural'));
                      }.bind(this));
                      this.params.options.unshift('');
                      this.params.translation = 'Global.scopeNames';
                  }
              });
          });
          As you can see from the code, the "return (defs.entity && (defs.object));" implies that the entity must have the entity attribute and the object attribute set to true.
          This is not the case for the Note entity, as you can see from "application\Espo\Resources\metadata\scopes\No te.j son":

          Code:
          {"entity":true,"layouts":false,"tab":false,"acl":false,"customizable":false}
          this is the reason why the Note entity is not appearing in target list for BPM Flowcharts.
          Still not sure if there is a clean solution to this.
          I can override the Note scope by adding "object":true but i don't know if this will cause the application to broke somewhere else.


          Last edited by Ceonello; 08-24-2021, 09:09 AM.

          Comment


          • #8
            Overriding Note scope by adding "object":true seems to work indeed,
            Do you think it is safe or it could be dangerous and break other parts of the application?


            By overriding I mean creating a file custom\Espo\Custom\Resources\metadata\scopes\Note. json with this content:
            Code:
            {"object":true}
            Last edited by Ceonello; 08-25-2021, 08:25 AM. Reason: Override details

            Comment

            Working...
            X