On Wed, Oct 29, 2008 at 9:05 AM, Blanco Emanuele <[EMAIL PROTECTED]> wrote: > I'm customizing an application. > > My CND is: > > <drools = 'http://www.jboss.org/drools-repository/1.0'> > <nt='http://www.jcp.org/jcr/nt/1.0'> > <mix='http://www.jcp.org/jcr/mix/1.0'> > <ns='http://www.mynamespace.org/1.0'> > > [ns:tipologia] > >> 'nt:hierarchyNode','mix:referenceable' > > - ns:figli (reference) multiple > - ns:padre (reference) > > > And the code I'm using is: > > Node padreNode = RulesRepository.addNodeIfNew(tipologieRootNode, > "padre", "ns:tipologia"); > Node figlioNode = RulesRepository.addNodeIfNew(tipologieRootNode, > "figlio", "ns:tipologia"); > padreNode.setProperty("ns:figli", figlioNode); <---- got exception here
multi-value properties are always set using arrays of values. however, since there's no javax.jcr .Node#setProperty(String, javax.jcr.Node[]) signature you'll have to pass an array of uuid's instead. [1] provides an example. cheers stefan [1] http://markmail.org/message/pkepzffwxpbxvdma > > The exception is: > > javax.jcr.nodetype.ConstraintViolationException: no matching property > definition > found for {http://www.mynamespace.org/1.0}figli > > RulesRepository.addNodeIfNew() is an utility method from the JBoss Drools > BRMS (which I'm going to customize), and it simply creates a Node. > > Thank you. > > -- > Emanuele Blanco > > Open Reply s.r.l. > C.so Francia 110, Torino > C e-mail: [EMAIL PROTECTED] > > -----Original Message----- > From: Alexander Klimetschek [mailto:[EMAIL PROTECTED] > Sent: martedì 28 ottobre 2008 18.53 > To: [email protected] > Subject: Re: properties declaration in CND > > On Tue, Oct 28, 2008 at 4:21 PM, Blanco Emanuele <[EMAIL PROTECTED]> wrote: >> But it doesn't work when I try to set the ns:property1 via the APIs (got a >> property doesn't exist exception or something similar). >> >> Am I missing something in the CND or there's something wrong with my code? > > I think it would be helpful if you could post your CND, the code and > the actual exception you get. > > Since you use reference properties, did you set a target node with > node.setProperty(String, Node)? > > Regards, > Alex > > -- > Alexander Klimetschek > [EMAIL PROTECTED] > > -- > The information transmitted is intended for the person or entity to which it > is addressed and may contain confidential and/or privileged material. Any > review, retransmission, dissemination or other use of, or taking of any > action in reliance upon, this information by persons or entities other than > the intended recipient is prohibited. If you received this in error, please > contact the sender and delete the material from any computer. >
