Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-2124

Overriding the "user_open_tasks" content view in Studio does not work as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 24
    • Component/s: Content Views, Workflow
    • Tags:
    • Impact type:
      Configuration Change
    • Upgrade notes:
      Hide

      Schemas generated by Studio will now always override existing schemas with same name.

      Show
      Schemas generated by Studio will now always override existing schemas with same name.

      Description

      I want to customize the content-view displayed in Home > Workflow, so it is sorted by my custom mytaskdoc:priority field, and this field also is displayed in the colums of the result table layout.

      It is the "user_open_tasks" that is used in this page, and here is what I did:

      • Create a MyTaskDoc document type, with the appropriate facets and lifecycle (so it can be used as task document). The schema just have a priority integer field
      • Import the task schema in the registry (because we need to use it in the search layout of the content-view and in the table layout of the results)
        {
          "schemas": {
            "task": {
              "@prefix": "nt",
              "accepted": "boolean", 
              "actors": "string[]", 
              "delegatedActors": "string[]", 
              "directive": "string", 
              "dueDate": "date", 
              "initiator": "string", 
              "name": "string", 
              "processId": "string", 
              "targetDocumentId": "string", 
              "targetDocumentsIds": "string[]",
              "taskComments": {
                "fields": {
                  "author": "string", 
                  "creationDate": "date", 
                  "text": "string"
                },
                "type": "complex[]"
              },
              "task_variables ": {
                "fields": {
                  "value": "string", 
                  "key": "string"
                },
                "type": "complex[]"
              }
            }
          }
        }
        
      • Create the routing_user_open_task_listing Table Layout. It will be used by the content view.
        • Add the {mytaskdoc:priority}

          field in one column, default value 0

        • NOTE: This step probably is not mandatory, it should be able to create the result columns directly in the content-view. But I started my testing by overriding this result table layout (and it worked with the default "user_open_tasks" content view)
      • Create the "user_open_tasks" content view
        • Set its static query as the one defined in the original XML:
          ecm:mixinType IN ('RoutingTask') AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState = 'opened' AND ecm:isProxy = 0
          
        • Set the default sort on mytaskdoc:priority, descending ("ascending" not checked)
        • Create the search layout with
          • Task name (field nt:name), ILIKE as operator
          • Task due date (field nt:dueDate), BETWEEN as operator
          • Priority (field mytaskdoc:priority, = as operator)
        • Set the result columns to the existing {routing_user_open_task_listing}} Table Layout.

      Also, of course, have a workflow whose tasks use the MyTaskDoc document type. Can be a basic one: Just start/stop and an "Approve" task which uses this document type.

      Now, update the server, create some documents, start the workflow on each of them. No need to handle the priority at this time.

      Then, go to Home > Workflow, see the list of tasks is displayed and ordered by priority (well, they are all at O).

      Query on priority, for example, query on priority equals 5 => all the tasks are displayed, and server.log states the priority field is not found

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: