AnsweredAssumed Answered

Duplicate Rule Folder

Question asked by rbergstrom on Jul 15, 2008
Hello:

[Edit: Forgot to put in system stats]
We are running 2.1C on Linux against postgresql.

My session timed out while trying to create a content rule on the Company Home folder (during the wizard).  After re-authenticating, I received the following error:
Failed to create Rule due to error: There is more than one rule folder, which is invalid.

I saw an bug about mulitple clicks causing a duplicate rule folder that had been resolved, but no work around / corrective action was listed.

Using the node browser:

Children
Child Name   Child Node   Primary   Association Type   Index
{http://www.alfresco.org/model/application/1.0}dictionary   workspace://SpacesStore/1f62ec8a-492f-11dd-96e3-c171a8e2e52c   true   {http://www.alfresco.org/model/content/1.0}contains   0
{http://www.alfresco.org/model/application/1.0}guest_home   workspace://SpacesStore/1fe05906-492f-11dd-96e3-c171a8e2e52c   true   {http://www.alfresco.org/model/content/1.0}contains   1
{http://www.alfresco.org/model/application/1.0}user_homes   workspace://SpacesStore/1ff4f27a-492f-11dd-96e3-c171a8e2e52c   true   {http://www.alfresco.org/model/content/1.0}contains   2
{http://www.alfresco.org/model/rule/1.0}ruleFolder   workspace://SpacesStore/e9a7d571-4cf2-11dd-8e65-6bcdf4399333   true   {http://www.alfresco.org/model/content/1.0}contains   3
{http://www.alfresco.org/model/content/1.0}Business Development   workspace://SpacesStore/bc92470e-4eab-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   4
{http://www.alfresco.org/model/content/1.0}Contracts   workspace://SpacesStore/8cb1b28f-4eac-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   5
{http://www.alfresco.org/model/content/1.0}Client Account Management   workspace://SpacesStore/acfe4846-4eac-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   6
{http://www.alfresco.org/model/content/1.0}Client Projects   workspace://SpacesStore/c35790e5-4eac-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   7
{http://www.alfresco.org/model/content/1.0}Solution Management   workspace://SpacesStore/e74346a8-4eac-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   8
{http://www.alfresco.org/model/content/1.0}Operations   workspace://SpacesStore/f606dffd-4eac-11dd-b71a-9f7ff37bf0b8   true   {http://www.alfresco.org/model/content/1.0}contains   9

Update:  The offending code in RuleServiceImpl.java

   private NodeRef getSavedRuleFolderRef(NodeRef nodeRef)
   {
        NodeRef result = null;
       
      List<ChildAssociationRef> assocs = this.runtimeNodeService.getChildAssocs(
                nodeRef,
                RegexQNamePattern.MATCH_ALL,
                RuleModel.ASSOC_RULE_FOLDER);
      if (assocs.size() > 1)
      {
         throw new ActionServiceException("There is more than one rule folder, which is invalid.");
      }
        else if (assocs.size() == 1)
        {
            result = assocs.get(0).getChildRef();
        }
      
      return result;
   }

Doing the database query myself against alf_child_assoc still yields only one rule folder.  Though, I'd note that the version field for the rule folder is "1" where the other child assoc are "2".


select version, type_qname, qname  from alf_child_assoc where parent_node_id = 34;
version |                     type_qname                      |                                qname                                
———+—————————————————–+———————————————————————-
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Public
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Operations
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Solution Management
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Client Projects
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Client Account Management
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Contracts
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/content/1.0}Business Development
       1 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/rule/1.0}ruleFolder
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/application/1.0}user_homes
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/application/1.0}guest_home
       2 | {http://www.alfresco.org/model/content/1.0}contains | {http://www.alfresco.org/model/application/1.0}dictionary

Any insight as to why the call is returning multiple rule folders?

// Robert

Outcomes