Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-13676

Allow Tasklist variables to be saved to engine variables before completion

    • Icon: Feature Request Feature Request
    • Resolution: Won't Fix
    • Icon: L3 - Default L3 - Default
    • None
    • 7.16.0-alpha2
    • tasklist

      User Story (Required on creation):

      As a Tasklist user, I want the ability to store my modified state of the Tasklist form to local variables (not only to browser local storage). If another users views the form, they are able to view the current state and variables in the form.

      Functional Requirements (Required before implementation):

      • I can configure the behavior of the Save button in Tasklist to either save to local storage (default) or to local task variables
      • The form data is correctly loaded based on that configuration

      Technical Requirements (Required before implementation):

      • Users can configure the behavior of the Save button in Tasklist form via Tasklist configuration
      • Default behavior remains as-is, saving to the browser's local storage
      • The execution of the Save button respects that configuration
      • Procedure to load data into the form can handle configuration changes (from local storage to local variables and back)

      Limitations of Scope (Optional):

      Hints (Optional):

      Currently the Save button in Tasklist forms provides the ability to save the state of the form to local storage. This is only useful when only one person needs access to the task but not ideal for task collaboration spanning multiple users.

      The requirement is to have another mechanism that can populate the task form fields as local task variables. As of now, the form fields get populated into the process instance only when you complete the task.

        This is the controller panel for Smart Panels app

            [CAM-13676] Allow Tasklist variables to be saved to engine variables before completion

            Hey shan-96,

            thanks for the feature request. This is a nice idea. I can certainly see the value in it.

            I do see a potential risk with concurrent executions and setting the form values as process instance variables. Imagine filling out half a form and persisting the variables on the process instance level without completing the task. Concurrent executions (e.g. if there was a parallel gateway) would be able to see those variables already even though the task is not completed. One solution here could be to make the variables local to the task. So that means it could be done by calling https://docs.camunda.org/manual/latest/reference/rest/task/local-variables/put-local-task-variable/.

            I will forward this to product management for prioritization. That said, I don't think there will be room on our roadmap to build this feature any time soon. Would you be interested in contributing? We can assist with questions and guidance during the process.

            Let me know what you think.
            Best,
            Miklas

            Miklas Boskamp added a comment - Hey shan-96 , thanks for the feature request. This is a nice idea. I can certainly see the value in it. I do see a potential risk with concurrent executions and setting the form values as process instance variables. Imagine filling out half a form and persisting the variables on the process instance level without completing the task. Concurrent executions (e.g. if there was a parallel gateway) would be able to see those variables already even though the task is not completed. One solution here could be to make the variables local to the task. So that means it could be done by calling https://docs.camunda.org/manual/latest/reference/rest/task/local-variables/put-local-task-variable/ . I will forward this to product management for prioritization. That said, I don't think there will be room on our roadmap to build this feature any time soon. Would you be interested in contributing? We can assist with questions and guidance during the process. Let me know what you think. Best, Miklas

            Shantanu Patil added a comment - - edited

            Hi @Miklas Boskamp,

            Thanks for your reply and taking this up. Yes using put-local-task-variable] seems a good approach.

            I will be happy to contribute! Please let me know once product management decides to put this ahead.

            Shantanu Patil added a comment - - edited Hi @Miklas Boskamp, Thanks for your reply and taking this up. Yes using put-local-task-variable ] seems a good approach. I will be happy to contribute! Please let me know once product management decides to put this ahead.

            Hi shan-96,

            thanks again for bringing this up. While we think this generally is a valid use case, we will not consider to build this into the default forms behavior in Tasklist as of now.
            We think that adding another Save button to offer such behavior in general confuses the UX for the general use case.
            Changing the default behavior of the current Save button is also something we will not consider for multiple reasons, for example backwards compatibility and possible user confusion.

            That being said, the embedded forms offer a lot of room for customization. This can also solve your use case here, I think.
            You can use the cam-script directive inside your embedded form and hook into the "store" lifecycle event with a script like this:

                camForm.on('store', function(evt) {
                  // handle store
                  // may prevent the store from being executed
                  evt.storePrevented = true;
                });
            

            In that script, you can than use the mentioned put local task variable endpoint to store your variables local to the user task.

            Let us know if that helps you or if you would like to discuss this further.

            Best,
            Tobias

            Tobias Metzke-Bernstein added a comment - Hi shan-96 , thanks again for bringing this up. While we think this generally is a valid use case, we will not consider to build this into the default forms behavior in Tasklist as of now. We think that adding another Save button to offer such behavior in general confuses the UX for the general use case. Changing the default behavior of the current Save button is also something we will not consider for multiple reasons, for example backwards compatibility and possible user confusion. That being said, the embedded forms offer a lot of room for customization. This can also solve your use case here, I think. You can use the cam-script directive inside your embedded form and hook into the "store" lifecycle event with a script like this: camForm.on( 'store' , function (evt) { // handle store // may prevent the store from being executed evt.storePrevented = true ; }); In that script, you can than use the mentioned put local task variable endpoint to store your variables local to the user task. Let us know if that helps you or if you would like to discuss this further. Best, Tobias

            Hi Tobias,

            Thanks for suggesting this workaround.

            Unfortunately, users in my organisation use the Camunda Modeler to create these forms and I am not sure if we can use the Forms SDK there. Additionally the reason I came up with this requirement was because a majority of users where I work (including me) initially thought this is what the save button would do. It was a bit counter-intuitive to understand that it merely stores the variables in local storage.

            From the Forms SDK I gather that you do not plan have lot of features in it so I understand if this won't be a part of your roadmap.

            So it looks like I will have to write a plugin that does this. Any idea where should I start with that?

            Thanks

            Shantanu Patil added a comment - Hi Tobias, Thanks for suggesting this workaround. Unfortunately, users in my organisation use the Camunda Modeler to create these forms and I am not sure if we can use the Forms SDK there. Additionally the reason I came up with this requirement was because a majority of users where I work (including me) initially thought this is what the save button would do. It was a bit counter-intuitive to understand that it merely stores the variables in local storage. From the Forms SDK I gather that you do not plan have lot of features in it so I understand if this won't be a part of your roadmap. So it looks like I will have to write a plugin that does this. Any idea where should I start with that? Thanks

            Hi shan-96,

            thanks for describing your use case in more detail.
            If writing your own forms is not an option for you, writing a plugin for Tasklist might be an option here, yes.

            Looking at the available plugin points, going for a custom "Form" tab at tasklist.task.detail would probably be a good starting point.
            This custom form tab could use the same directives the default form tab uses.
            You would have to shadow the provider and replace the Save button with one that calls the already mentioned task variables API to persist the variables locally with the task.
            You would probably want to disable the default form tab as well, so your registered custom form tab replaces it.

            Now, other users have done similar things already, as far as we are aware. Please note however that this requires some deeper knowledge of the Tasklist architecture and AngularJS.

            I hope that helps you making progress on this.

            Best,
            Tobias

            Tobias Metzke-Bernstein added a comment - Hi shan-96 , thanks for describing your use case in more detail. If writing your own forms is not an option for you, writing a plugin for Tasklist might be an option here, yes. Looking at the available plugin points , going for a custom "Form" tab at tasklist.task.detail would probably be a good starting point. This custom form tab could use the same directives the default form tab uses. You would have to shadow the provider and replace the Save button with one that calls the already mentioned task variables API to persist the variables locally with the task. You would probably want to disable the default form tab as well, so your registered custom form tab replaces it. Now, other users have done similar things already, as far as we are aware. Please note however that this requires some deeper knowledge of the Tasklist architecture and AngularJS. I hope that helps you making progress on this. Best, Tobias

            Tobias Metzke-Bernstein added a comment - - edited

            Hi shan-96,

            we have updated the ticket to reflect our current status on this.

            We have decided to consider adding a configuration option to Tasklist that allows to define the behavior of the Save button in Tasklist forms.
            Users will be able to decide if this button saves the fields to local browser storage (this will still be the default) or save them as local task variables.
            Let us know if the ticket description covers your intentions or if there is anything you would like to add.

            We have neither prioritized nor scheduled this ticket yet, so we cannot guarantee that we will work on this in the near future. This will however be considered in the next prioritization rounds and is moved to our backlog.

            Best,
            Tobias

            Tobias Metzke-Bernstein added a comment - - edited Hi shan-96 , we have updated the ticket to reflect our current status on this. We have decided to consider adding a configuration option to Tasklist that allows to define the behavior of the  Save button in Tasklist forms. Users will be able to decide if this button saves the fields to local browser storage (this will still be the default) or save them as local task variables. Let us know if the ticket description covers your intentions or if there is anything you would like to add. We have neither prioritized nor scheduled this ticket yet, so we cannot guarantee that we will work on this in the near future. This will however be considered in the next prioritization rounds and is moved to our backlog. Best, Tobias

            Thanks Tobias.
            Yes this covers our use case as long as 2 independent users can remotely update the Tasklist form variables without completing the task itself.
            However once this is prioritised and implemented, will this feature be available only in the latest release or you also would also roll in into maintainence branches like 7.15.x, 7.14.x?

            Shantanu Patil added a comment - Thanks Tobias. Yes this covers our use case as long as 2 independent users can remotely update the Tasklist form variables without completing the task itself. However once this is prioritised and implemented, will this feature be available only in the latest release or you also would also roll in into maintainence branches like 7.15.x, 7.14.x?

            Hi shan-96,

            However once this is prioritised and implemented, will this feature be available only in the latest release or you also would also roll in into maintainence branches like 7.15.x, 7.14.x?

            this would be decided on criticality, usually a new feature like this will only be available in the latest version.
            Since maintenance builds are only available for enterprise customers, you would need to file for a Support ticket to express that need with reference to this ticket here.

            Hope that helps.

            Best,
            Tobias

            Tobias Metzke-Bernstein added a comment - Hi shan-96 , However once this is prioritised and implemented, will this feature be available only in the latest release or you also would also roll in into maintainence branches like 7.15.x, 7.14.x? this would be decided on criticality, usually a new feature like this will only be available in the latest version. Since maintenance builds are only available for enterprise customers, you would need to file for a Support ticket to express that need with reference to this ticket here. Hope that helps. Best, Tobias

            We are closing this ticket as part of our backlog grooming. Reasons:

            • It is very unlikely that we will implement this
            • We did not receive sufficient evidence that this ticket is important

            Thorben Lindhauer added a comment - We are closing this ticket as part of our backlog grooming. Reasons: It is very unlikely that we will implement this We did not receive sufficient evidence that this ticket is important

              Unassigned Unassigned
              shan-96 Shantanu Patil
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: