AnsweredAssumed Answered

Integrity Violations

Question asked by yusuf on Apr 28, 2008
Latest reply on May 2, 2008 by yusuf
Hi all,

I've been reading a book about Alfresco Enterprise Content Management by Munwar Shariff. In this book a scripting example is given:
——————————————————————————————
var stagingFolder = companyhome.childByNamePath("Intranet/Marketing
Communications/Website Documents/Staging");
var productionFolder = companyhome.childByNamePath("Intranet/Marketing
Communications/Website Documents/Production");
if(stagingFolder != null)
{
var i=0;
var today = new Date();
stagingChildren = stagingFolder.children;
stagingTotal = stagingChildren.length;
for(i=0; i<stagingTotal;i++)
{
child = stagingChildren;
if(child.properties["cm:from"] <= today)
{
child.move(productionFolder);
}
}
}

——————————————————————————————

when I try to implement this script I get the following error:
——————————————————————————————
Failed to run Actions due to error: Found 1 integrity violations: The association parent multiplicity has been violated: Target Node: workspace://SpacesStore/b5b0189a-1487-11dd-b98a-a3150a38c112 Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/rule/1.0}rules], name={http://www.alfresco.org/model/rule/1.0}ruleFolder, target class={http://www.alfresco.org/model/content/1.0}systemfolder, source role=null, target role=null] Required parent Multiplicity: 1..1 Actual parent Multiplicity: 0
——————————————————————————————
What's the problem here. How can this be solved?
Thanks in advance,
Yusuf

Outcomes