Hi,

> But when I go to run the create_child
> method
> it returns: outMap contains status=2 and statusText="UnknownMethod".
> Why is
> it an unknown method?

The ParentComponent generated code in ParentComponent.cpp should have a method 
called "doMethod()", which handles the method call on the agent.  By default, 
if the method name string passed into this method does not match the method 
name string from the schema definition, doMethod() will return that error.

You'll need to take a look - either under a debugger, or by adding log messages 
- at ParentComponent::doMethod() when you invoke your method to see the actual 
method name being passed in.

> Also. in doing some more investigation it
> appears that
> in QMF, the object model to support any relationship defined in the
> schema
> must be built manually on top of the generated classes i.e. there is
> no
> inherent support for this. Is this true? 

In most cases, it is true that relationships among the data objects needs to be 
modelled by the application rather than QMF. An example of this would be the 
parent/child relationship given in the qmf-agent example under 
qpid/cpp/examples.  Can you explain the specific relationship you are trying to 
model?  

> Also, if I am using the
> Python
> console classes to access the raw managed objects, it appears that
> when I
> query the parent class I would not see the child class. Is this true?

They are independent objects, as far as a QMF query is concerned.  This 
relationship would have to be managed by the application.  For example, you 
could define a list of child object id's in your parent class.  When you create 
a child, your parent's child create method could add the new child's object id 
into that list.  Very similar to having the "ParentRef" property in the child 
component class.


-K

----- "QPID User" <[email protected]> wrote:

> Hi all,
> 
> I am using QMF 2 and I currently have a schema where i have 2 objects
> defined, a parent and child as follows.
> 
> <class name="ParentComponent">
> 
> <property name="parentId" type="int32" access="RC" index="y"/>
> 
> <property name="parentTypeId" type="int32" access="RC" index="y"/>
> 
> <property name="Name" type="lstr" access="RO"/>
> 
> <statistic name="state" type="sstr" desc="Operational state"/>
> 
> <method name="create_child" desc="Create child object">
> 
> <arg name="childId" dir="I" type="int32"/>
> 
> <arg name="childRef" dir="O" type="objId"/>
> 
> </method>
> 
>  </class>
> 
> 
> 
> <class name="ChildComponent">
> 
> <property name="ParentRef" type="objId" references="ParentComponent"
> access=
> "RC" index="y" parentRef="y"/>
> 
> <property name="childId" type="int32" access="RC" index="y"/>
> 
> <property name="Name" type="lstr" access="RO"/>
> 
> <statistic name="state" type="sstr" desc="Operational state"/>
> 
> <method name="delete"/>
> 
> </class>
> 
> 
> 
> It successfully generates the necessary managed object files i.e.
> ParentComponent.h (.cpp) etc.  But when I go to run the create_child
> method
> it returns: outMap contains status=2 and statusText="UnknownMethod".
> Why is
> it an unknown method? Also. in doing some more investigation it
> appears that
> in QMF, the object model to support any relationship defined in the
> schema
> must be built manually on top of the generated classes i.e. there is
> no
> inherent support for this. Is this true? Also, if I am using the
> Python
> console classes to access the raw managed objects, it appears that
> when I
> query the parent class I would not see the child class. Is this true?
> 
> Any help is appreciated. Thanks.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to