CMDBuild Forum

cmdbuild 2.3.2 can't convert CardDescriptor with referenceTypeFrom

Hello,

I am working with cmdbuild 2.3.2 and shark 4.4.1

I did like in the example RequestForChange :

1/ my_var_list = queryClass(my_Class).with("Id", my_Id_value).fetch()

2/ my_element_list = my_var_list.get(0)

3/ my_Id = my_element_list.getId() => OK, my_Id has the rigth information

3.1/ my_class = my_element_list.getClassName => OK, my_class has the rigth information

when i try to obtain the class Code i do : my_class_code = (cmdb.cardFrom(cmdb.referenceTypeFrom(my_element_list))).getCode() => NOK, my_class_code is empty with no workflow error.

I think i tried any ways to return the class Code (i spent 2 days on this problem) but no succes, i don't know what to do now, some one can help me please.

 

congratulation

Dear Benoist,
 
we've just tried with the last release and "Code" attribute can be successfully read. We used exactly this script
 
__list__ = cmdb.queryClass("Employee")
.with("Id", Requester.getId())
.fetch();
__element__ = __list__.get(0);
System.out.println("XXX id: " + __element__.getId());
System.out.println("XXX classname: " + __element__.getClassName());
__reference__ = cmdb.referenceTypeFrom(__element__);
__card__ = cmdb.cardFrom(__reference__);
System.out.println("XXX code: " + __card__.getCode());
 
applied to the RFC demo workflow.
 
Do you have limitations/permissions on your data model?
 
Best regards.
 
-- CMDBuild Team
 
Previously Benoist wrote:

Hello,

I am working with cmdbuild 2.3.2 and shark 4.4.1

I did like in the example RequestForChange :

1/ my_var_list = queryClass(my_Class).with("Id", my_Id_value).fetch()

2/ my_element_list = my_var_list.get(0)

3/ my_Id = my_element_list.getId() => OK, my_Id has the rigth information

3.1/ my_class = my_element_list.getClassName => OK, my_class has the rigth information

when i try to obtain the class Code i do : my_class_code = (cmdb.cardFrom(cmdb.referenceTypeFrom(my_element_list))).getCode() => NOK, my_class_code is empty with no workflow error.

I think i tried any ways to return the class Code (i spent 2 days on this problem) but no succes, i don't know what to do now, some one can help me please.

 

congratulation