I successfully used the cosmos API and get the output , But for my
project the requirement is that I should not load all the items from the
db because the db may have the miilions of records. But on the query there
can be a empty template [ please see the example query below ] and that
empty template can be as a source or target into the relaitonship template.

But when I have a empty template as per the cosmos API it loads all
the items logically , But If I don't have the ItemTemplateHandler and
having the empty item template in the query I am getting the exception as
"Unsupported Constraint Type" exception.

I don't want to load the all the items from the db , but want to load
only the items that is having the relationship with the source or target.
In my example I am having the empty template as a source , So I can pass
the source as null to the DB and get the items having a RUNSON
relaitonship with the target template items and want to add these items
into the query response.
I added the empty item on my ItemTemplateHandler and again create the item
handler in my relationshiprecordtypehanlder to add the source items which
I got after I apply the relationship record type , But I am not getting
the source items in my query response and still getting the empty item
element on the query response.

Is there a way in the cosmos API for doing this or I need to write my
own code to do this ? If I need to write my own code which part of the
code needs to be changed or Can I extend any of the class and write my
code to do this?

arunachalam wrote:
> Hi ,
> I successfully used the cosmos API and get the output , But for my
> project the requirement is that I should not load all the items from the
> db because the db may have the miilions of records. But on the query
> there can be a empty template [ please see the example query below ] and
> that empty template can be as a source or target into the relaitonship
> template.
>
> But when I have a empty template as per the cosmos API it loads all
> the items logically , But If I don't have the ItemTemplateHandler and
> having the empty item template in the query I am getting the exception
> as "Unsupported Constraint Type" exception.
>
> I don't want to load the all the items from the db , but want to
> load only the items that is having the relationship with the source or
> target. In my example I am having the empty template as a source , So I
> can pass the source as null to the DB and get the items having a RUNSON
> relaitonship with the target template items and want to add these items
> into the query response.
> I added the empty item on my ItemTemplateHandler and again create the
> item handler in my relationshiprecordtypehanlder to add the source items
> which I got after I apply the relationship record type , But I am not
> getting the source items in my query response and still getting the
> empty item element on the query response.
>
>
> Is there a way in the cosmos API for doing this or I need to write
> my own code to do this ? If I need to write my own code which part of
> the code needs to be changed or Can I extend any of the class and write
> my code to do this?
>
> Regards
>
> Arunachalam

Hi Arunachalam,

My apologies for the long delay in responding. Thank you for your
detailed post.

You can look at the Aperi MDR example as an example of overriding the
handler processing to gain more control in the process.

Also, for the case you describe immediately after that, does it also
seem to be working improperly? If so, please create a defect for that
as well. And if you have any specific API requests, feel free to create
an enhancement request in Bugzilla so we can prioritize the effort.

I have added one method as "processEmptyTemplates(IQueryResult result)
and calling this method after the
"processRelationshipTemplates(cmdbfQuery, queryResult);" method call in
this method.

In the itemtemplatehandler I am adding the empty item and adding the
template id into map with empty item [ Nodes ] , So that we will get the
template id with the empty item and in relationship record type handler, I
am getting actual item [ because I am getting the item only when I am
executing the relationship ] and update this map.So this map will be
filled once the method "processRelationshipTemplates(cmdbfQuery,
queryResult);" is called. I am calling the method which is by me after
this method and this method take care in appending the nodes [ which is
filled during the relaitonship process ] to the empty template [ during
the item template handler processing ].

And this is working fine for me, But I don't think this will be an
temporary solution.

I have added one method as "processEmptyTemplates(IQueryResult result)
and calling this method after the
"processRelationshipTemplates(cmdbfQuery, queryResult);" method call in
this method.

In the itemtemplatehandler I am adding the empty item and adding the
template id into map with empty item [ Nodes ] , So that we will get the
template id with the empty item and in relationship record type handler, I
am getting actual item [ because I am getting the item only when I am
executing the relationship ] and update this map.So this map will be
filled once the method "processRelationshipTemplates(cmdbfQuery,
queryResult);" is called. I am calling the method which is by me after
this method and this method take care in appending the nodes [ which is
filled during the relaitonship process ] to the empty template [ during
the item template handler processing ].

And this is working fine for me, But I don't think this will be an
temporary solution.

arunachalam wrote:
> Hi ,
> I successfully used the cosmos API and get the output , But for my
> project the requirement is that I should not load all the items from the
> db because the db may have the miilions of records. But on the query
> there can be a empty template [ please see the example query below ] and
> that empty template can be as a source or target into the relaitonship
> template.
>
> But when I have a empty template as per the cosmos API it loads all
> the items logically , But If I don't have the ItemTemplateHandler and
> having the empty item template in the query I am getting the exception
> as "Unsupported Constraint Type" exception.
>
> I don't want to load the all the items from the db , but want to
> load only the items that is having the relationship with the source or
> target. In my example I am having the empty template as a source , So I
> can pass the source as null to the DB and get the items having a RUNSON
> relaitonship with the target template items and want to add these items
> into the query response.
> I added the empty item on my ItemTemplateHandler and again create the
> item handler in my relationshiprecordtypehanlder to add the source items
> which I got after I apply the relationship record type , But I am not
> getting the source items in my query response and still getting the
> empty item element on the query response.
>
>
> Is there a way in the cosmos API for doing this or I need to write
> my own code to do this ? If I need to write my own code which part of
> the code needs to be changed or Can I extend any of the class and write
> my code to do this?
>
> Regards
>
> Arunachalam

Hi Arunachalam,

My apologies for the long delay in responding. Thank you for your
detailed post.

You can look at the Aperi MDR example as an example of overriding the
handler processing to gain more control in the process.

Also, for the case you describe immediately after that, does it also
seem to be working improperly? If so, please create a defect for that
as well. And if you have any specific API requests, feel free to create
an enhancement request in Bugzilla so we can prioritize the effort.

I have added one method as "processEmptyTemplates(IQueryResult result)
and calling this method after the
"processRelationshipTemplates(cmdbfQuery, queryResult);" method call in
this method.

In the itemtemplatehandler I am adding the empty item and adding the
template id into map with empty item [ Nodes ] , So that we will get the
template id with the empty item and in relationship record type handler, I
am getting actual item [ because I am getting the item only when I am
executing the relationship ] and update this map.So this map will be
filled once the method "processRelationshipTemplates(cmdbfQuery,
queryResult);" is called. I am calling the method which is by me after
this method and this method take care in appending the nodes [ which is
filled during the relaitonship process ] to the empty template [ during
the item template handler processing ].

And this is working fine for me, But I don't think this will be an
temporary solution.

I have added one method as "processEmptyTemplates(IQueryResult result)
and calling this method after the
"processRelationshipTemplates(cmdbfQuery, queryResult);" method call in
this method.

In the itemtemplatehandler I am adding the empty item and adding the
template id into map with empty item [ Nodes ] , So that we will get the
template id with the empty item and in relationship record type handler, I
am getting actual item [ because I am getting the item only when I am
executing the relationship ] and update this map.So this map will be
filled once the method "processRelationshipTemplates(cmdbfQuery,
queryResult);" is called. I am calling the method which is by me after
this method and this method take care in appending the nodes [ which is
filled during the relaitonship process ] to the empty template [ during
the item template handler processing ].

And this is working fine for me, But I don't think this will be an
temporary solution.