1 Reply Latest reply on May 23, 2018 2:34 PM by Mateus Santilli

    how to add an extra column in the task list - Task Inbox

    Mateus Santilli Newbie

      Hello,

       

      Version: Jbpm 7.7.0

       

      I need to modify the Task List in kie workbench by adding an extra column in the task list.

      This extra column will receive information about the value of a process variable that is running here.

       

       

      What I'm trying to do is:

       

      jbpm-wb-human-tasks-backend

           I changed the DataSetDefsBootstrap class and added in the select the new information I want to bring in the task screen;

       

      protected void registerDataSetDefinitions() {

              SQLDataSetDefBuilderImpl builder = DataSetDefFactory.newSQLDataSetDef()

                      .uuid(HUMAN_TASKS_DATASET)

                      .name("Human tasks")

                      .dataSource(JBPM_DATA_SOURCE)

                      .dbSQL("select " +

                                     SQL_SELECT_COMMON_COLS + ", " +

                                     "(select tv.value FROM TaskVariableImpl tv WHERE tv.processInstanceId = t.processInstanceId AND tv.name = \'CodCir\' LIMIT 1) as \"" + COLUMN_CUSTOM_CANCEL_CIRCUITO + "\" " +

                                     "from " +

                                          "AuditTaskImpl t " +

                                     "left join " +

                                          "ProcessInstanceLog pil " +

                                     "on " +

                                          "pil.id=t.processInstanceId"

                              ,

                             false);

              builder = addBuilderCommonColumns(builder)

                        .number(COLUMN_CUSTOM_CANCEL_CIRCUITO);

              DataSetDef humanTasksDef = builder.buildDef();

       

       

       

       

      jbpm-wb-human-tasks-api

           I changed the TaskSummary class and added a new variable to the information. I generated the get / sets and the build.

            private Integer cancelamentoCircuito;

             ......

             public Integer getCancelamentoCircuito() {

               return cancelamentoCircuito;

            }

            public void setCancelamentoCircuito(Integer cancelamentoCircuito) {

              this.cancelamentoCircuito = cancelamentoCircuito;

             }

           ....

           public Builder cancelamentoCircuito(Integer cancelamentoCircuito) {

                  this.taskSummary.setCancelamentoCircuito(cancelamentoCircuito);

                  return this;

              }

       

      jbpm-wb-human-tasks-client

           I changed the AbstractTaskListView class, initColumns method, I added the new column:

          columnMetas.add(new ColumnMeta<>(

              createNumberColumn(COLUMN_CUSTOM_CANCEL_CIRCUITO,

                                       task -> task.getCancelamentoCircuito()),

                      constants.Circuito()

              ));

       

       

           I changed the TaskSummaryDataSetMapper class and added the method call created in the TaskSummary class build;

           ...

          .cancelamentoCircuito(getColumnIntValue(dataSet,

                          COLUMN_CUSTOM_CANCEL_CIRCUITO,

                                  row))

           ...

       

      When accessing the task screen, it presents the attached image error:

       

       

      Could someone tell me what I'm doing wrong or if I need to do something else?

       

      Thank you so much!!