RE: [mdr-users] Operation as a context of ActivityGraph

"Leonardo Gresta Paulino Murta" <[email protected]> Thu, 23 Jun 2005 09:45:03 -0300
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Jarda,

	Thanks for the hint! However, when I do not set the namespace of the
ActivityGraph, the ActivityGraph is not written in XMI file. In other words:
I do not receive the CompositionViolationException and the generated XMI
file correctly has an element relating the xmiid of the Operation with the
xmiid of the ActivityGraph, but the ActivityGraph itself is not there...

	The attached file (test.xml) is the generated XMI file. It is using
SPEM metamodel, but SPEM is derived from UML metamodel. The element
"SPEM:A_behavior_contex" relates a WorkDefinition, which extends Operation,
with an ActivityGraph (xmi.idref = "a7"). However, the ActivityGraph itself
(xmiid = "a7") is not there! Do you have any other hints?

	Thanks a lot!!!

	Leo

> -----Original Message-----
> From: Jaroslav Drazan [mailto:[email protected]]
> Sent: Thursday, June 23, 2005 6:33 AM
> To: [email protected]
> Subject: Re: [mdr-users] Operation as a context of ActivityGraph
> 
> Hello Leo,
> You can't set the composition more than once. That's the reason why all
> compositions defined by UML (ModelElement in Namespace, Feature in
> Classifier...) are optional (multiplicity is 0..1). So if you want to
> specify ActivityGraph for some BehaviorFeature you mustn't specify its
> namespace (if it has been already set you must first set it to null).
> 
> Regards
> Jarda
> 
> > Hello,
> >
> > 	I am using UML metamodel and trying to set the context of an
> > ActivityGraph to an Operation. The specification says the context of an
> > ActivityGraph may be a BehavioralFeature. Moreover, Operation inherits
> from
> > BehavioralFeature. However, a CompositionViolationException is thrown.
> It
> > complains that I am trying to set more than one context to the
> > ActivityGraph. I suppose it considers the namespace where the
> ActivityGraph
> > is inserted as an existing context. Am I doing something wrong? What is
> the
> > correct way to set the context of an ActivityGraph to an Operation?
> Where
> > should I insert the ActivityGraph to avoid the
> > CompositionViolationException?
> >
> > 	Thanks,
> >
> > 	Leo
> >
> 
> ____________________________________________________________
> http://www.listicka.cz
test.xml (text/xml, 1.4 KB)
<?xml version = '1.0' encoding = 'ISO-8859-1' ?>
<XMI xmi.version = '1.2' xmlns:SPEM = 'org.omg.xmi.namespace.SPEM' timestamp = 'Mon May 23 17:34:12 BRT 2005'>
  <XMI.header>
    <XMI.documentation>
      <XMI.exporter>Netbeans XMI Writer</XMI.exporter>
      <XMI.exporterVersion>1.0</XMI.exporterVersion>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <SPEM:Package xmi.id = 'a1' name = 'SPEM Modeller View'>
      <SPEM:Namespace.ownedElement>
        <SPEM:WorkProduct xmi.id = 'a2' name = 'NewWorkProduct' isDeliverable = 'false'/>
        <SPEM:ProcessPerformer xmi.id = 'a3' name = 'NewProcessPerformer'>
          <SPEM:ProcessPerformer.work>
            <SPEM:WorkDefinition xmi.id = 'a4' name = 'NewWorkDefinition'/>
          </SPEM:ProcessPerformer.work>
        </SPEM:ProcessPerformer>
        <SPEM:ProcessRole xmi.id = 'a5' name = 'NewProcessRole'>
          <SPEM:ProcessPerformer.work>
            <SPEM:Activity xmi.id = 'a6' name = 'NewActivity'>
              <SPEM:WorkDefinition.parentWork>
                <SPEM:WorkDefinition xmi.idref = 'a4'/>
              </SPEM:WorkDefinition.parentWork>
            </SPEM:Activity>
          </SPEM:ProcessPerformer.work>
        </SPEM:ProcessRole>
      </SPEM:Namespace.ownedElement>
    </SPEM:Package>
    <SPEM:A_behavior_context>
      <SPEM:ActivityGraph xmi.idref = 'a7'/>
      <SPEM:WorkDefinition xmi.idref = 'a4'/>
    </SPEM:A_behavior_context>
  </XMI.content>
</XMI>