AnsweredAssumed Answered

Working with the fm:discussable aspect.

Question asked by risenhoover on Aug 20, 2008
I am trying to add a comment to a node by adding the fm:discussable aspect to the node.  Here's the relevant information from the content model:

      <aspect name="fm:discussable">
            <child-association name="fm:discussion">
                  <mandatory enforced="true">true</mandatory>

Essentially, it looks like the "fm:discussable" aspect requires a "fm:forum" class to be created and then attached to the "fm:discussable" via a child relationship called "fm:discussion."  This is how I interpret it, but it's probably wrong, since it's not working for me…

Here's the relevant web script code:

   var props = new Array(1);
    var discussion = node.createNode("Test Discussion", "fm:forum");
    props["fm.discussion"] = discussion;

    node.addAspect("fm:discussable", props);;

I'm creating the forum and including it in the addAspect() call since it's a mandatory relationship.  Unfortunately, I get an exception, stating the association child multiplicity has been violated.  (Sounds serious!)

Found 1 integrity violations:
The association child multiplicity has been violated:
   Source Node: workspace://SpacesStore/836dc1fb-6e45-11dd-9347-d1a109457541
   Association: Association[ class=ClassDef[name={}discussable], name={}discussion, target class={}forum, source role=null, target role=null]
   Required child Multiplicity: 1..1
   Actual child Multiplicity: 0

Any thoughts on what I could be doing wrong?