Enterprise 3.x
  1. Enterprise 3.x
  2. ETHREEOH-885

mapAuthorityToName tests don't handle sub-classed objects correctly.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.1
    • Component/s: Services
    • Security Level: external (External user)
    • Labels:
      None

      Description

      ACT-5580 Ticket Comment:

      I have examined the source code of Alfresco and have identified the problem. As I stated earlier, I believe that, by subclassing a cm:Person object into my own person type I'm causing the workflow engine to error out, because it's not recognizing the subclassed object as a cm:person.

      After examining the stack trace which I offered you, and comparing it to the source code of Alfresco, I can confirm that my statement is correct. If you examine the AlfrescoAssignmen.assign() method, on line 106 (which is near the WorkflowException is thrown) , you'll see the following:

                        String actor = null;
                          if (eval instanceof String)
                          {
                              actor = (String)eval;
                          }
                          else if (eval instanceof JBPMNode)
                          {
                              actor = mapAuthorityToName((JBPMNode)eval, false);
                          }
                          if (actor == null)
                          {
                              throw new WorkflowException("actor expression must evaluate to a person");
                          }

      If you then examine the mapAuthorityToName() method, you'll find this:


             QName type = authority.getType();
              if (type.equals(ContentModel.TYPE_PERSON))
              {
                  name = (String)authority.getProperties().get(ContentModel.PROP _USERNAME);
              }
              else if (type.equals(ContentModel.TYPE_AUTHORITY))
              {
                  name = authorityDAO.getAuthorityName(authority.getNodeRef());
              }
              else if (allowGroup && type.equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
              {
                  name = authorityDAO.getAuthorityName(authority.getNodeRef());
              }

      If you'll notice the first comparison, it's comparing the passed object with the ContentModel.TYPE_PERSON constant. This is an incorrect way to compare subclassable types, since it produces erroneous results, as it is my case.

        Activity

        Hide
        Paul Holmes-Higgin added a comment -
        Dave - an easy one for you?
        Show
        Paul Holmes-Higgin added a comment - Dave - an easy one for you?
        Hide
        David Caruana added a comment -
        CHK-6490
        Show
        David Caruana added a comment - CHK-6490
        Hide
        Steve Rigby added a comment -
        For retest on build 124 or later
        Show
        Steve Rigby added a comment - For retest on build 124 or later
        Hide
        mkononovich added a comment -
        Verified against 3.1E build 128.
        Show
        mkononovich added a comment - Verified against 3.1E build 128.

          People

          • Assignee:
            Closed Bugs
            Reporter:
            R.Charles Sweeten
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: