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

Add expression resolution support for formHandlerClass attribute

    • Icon: Feature Request Feature Request
    • Resolution: Duplicate
    • Icon: L3 - Default L3 - Default
    • None
    • None
    • engine
    • None

      Created on behalf of PR:

      User Story (Required on creation):

      As a user, I can set an expression to formHandlerClass attribute to resolve a class instance (and for example use beans) in Start Forms and User Task Forms.

      Example

      User Task XML Config:

      <bpmn:startEvent id="StartEvent_1" camunda:formHandlerClass="${mySpecialFormDataHandler}">
      

      handlers:

      @Component("mySpecialFormDataHandler")
      @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
      public class MyHandler extends DefaultStartFormHandler {
          @Override
          public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
              //Some validation goes here VALIDATION GOES HERE
      
              super.submitFormVariables(properties, variableScope);
          }
      }
      
      @Component("mySpecialUserTaskFormDataHandler")
      @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
      public class MyUtHandler extends DefaultTaskFormHandler {
          @Override
          public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
              //Some data validation logic goes here
              
              super.submitFormVariables(properties, variableScope);
          }
      }
      

      This can be used to implement data structure validation on the variables being sent: Such as "XYZ variable names can or cannot be created or modified", "The JSON object must match a specific Schema, etc.

      Functional Requirements (Required before implementation):

      • `formHandlerClass` attributes supports expressions for Start Forms and User Task Forms.
      • ...

      Technical Requirements (Required before implementation):

      Limitations of Scope (Optional):

      Hints (Optional):

        This is the controller panel for Smart Panels app

            [CAM-13387] Add expression resolution support for formHandlerClass attribute

            Yana Vasileva created issue -
            Yana Vasileva made changes -
            Description Original: h4. Created on behalf of PR:
            * https://github.com/camunda/camunda-bpm-platform/pull/1401

            h4. User Story (Required on creation):

            As a user, I can set an expression to [formHandlerClass|https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-attributes/#formhandlerclass] attribute to resolve a class instance (and for example use beans) in Start Forms and User Task Forms.
            h4. Example

            User Task XML Config:
            {code:xml}
            <bpmn:startEvent id="StartEvent_1" camunda:formHandlerClass="${mySpecialFormDataHandler}">
            {code}
            handlers:
            {code:java}
            @Component("mySpecialFormDataHandler")
            @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
            public class MyHandler extends DefaultStartFormHandler {
                @Override
                public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
                    //Some validation goes here VALIDATION GOES HERE

                    super.submitFormVariables(properties, variableScope);
                }
            }
            {code}
            {code:java}
            @Component("mySpecialUserTaskFormDataHandler")
            @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
            public class MyUtHandler extends DefaultTaskFormHandler {
                @Override
                public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
                    //Some data validation logic goes here
                    
                    super.submitFormVariables(properties, variableScope);
                }
            }
            {code}

            This can be used to implement data structure validation on the variables being sent: Such as "XYZ variable names can or cannot be created or modified", "The JSON object must match a specific Schema, etc.

            h4. Functional Requirements (Required before implementation):
            * `formHandlerClass` attributes supports expressions for Start Forms and User Task Forms.
            * ...
            h4. Technical Requirements (Required before implementation):
            h4. Limitations of Scope (Optional):
            h4. Hints (Optional):
            New: h4. Created on behalf of PR:
            * https://github.com/camunda/camunda-bpm-platform/pull/1401

            h4. User Story (Required on creation):

            As a user, I can set an expression to [formHandlerClass|https://docs.camunda.org/manual/latest/reference/bpmn20/custom-extensions/extension-attributes/#formhandlerclass] attribute to resolve a class instance (and for example use beans) in Start Forms and User Task Forms.
            h4. Example

            User Task XML Config:
            {code:xml}
            <bpmn:startEvent id="StartEvent_1" camunda:formHandlerClass="${mySpecialFormDataHandler}">
            {code}
            handlers:
            {code:java}
            @Component("mySpecialFormDataHandler")
            @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
            public class MyHandler extends DefaultStartFormHandler {
                @Override
                public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
                    //Some validation goes here VALIDATION GOES HERE

                    super.submitFormVariables(properties, variableScope);
                }
            }
            {code}
            {code:java}
            @Component("mySpecialUserTaskFormDataHandler")
            @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
            public class MyUtHandler extends DefaultTaskFormHandler {
                @Override
                public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
                    //Some data validation logic goes here
                    
                    super.submitFormVariables(properties, variableScope);
                }
            }
            {code}

            This can be used to implement data structure validation on the variables being sent: Such as "XYZ variable names can or cannot be created or modified", "The JSON object must match a specific Schema, etc.

            h4. Functional Requirements (Required before implementation):
            * `formHandlerClass` attributes supports expressions for Start Forms and User Task Forms.
            * ...

            h4. Technical Requirements (Required before implementation):

            h4. Limitations of Scope (Optional):

            h4. Hints (Optional):
            Yana Vasileva made changes -
            Mentioned Roles
            Yana Vasileva made changes -
            Mentioned Groups
            Yana Vasileva made changes -
            Assignee New: Thorben Lindhauer [ thorben.lindhauer ]
            Yana Vasileva made changes -
            Mentioned Roles
            Yana Vasileva made changes -
            Mentioned Groups
            Yana Vasileva made changes -
            Link New: This issue is related to CAMTEAM-158 [ CAMTEAM-158 ]
            Tassilo Weidner made changes -
            Link New: This issue duplicates CAM-13330 [ CAM-13330 ]
            Tassilo Weidner made changes -
            Resolution New: Duplicate [ 3 ]
            Status Original: Open [ 1 ] New: Closed [ 6 ]
            Tassilo Weidner made changes -
            Mentioned Roles
            Tassilo Weidner made changes -
            Mentioned Groups

              thorben.lindhauer Thorben Lindhauer
              yana.vasileva Yana Vasileva
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: