cancel
Showing results for 
Search instead for 
Did you mean: 

SUP2.2 Generated HybridApp.js does not contains any method to fetch data from different related MBO

Former Member
0 Kudos

HI,

I have created three MBO's (MBO1 , MBO2 , MBO3) from three different tables (Table1 ,  Table2, table3).

Further i created relationship between these MBO's as MBO1 is the parent and both MBO2 and MBO3 are its child.

Then i deployed the project into sup server(2.2) .

Then i  Generated Hybrid App API.

Now, I am not able to find any method in HybirdApp.js to get the attributes for child MBO (let say MBO2) from parent MBO (say MBO1).

Please attach the sample code.

Thanks,

Ankit Garg

Accepted Solutions (0)

Answers (1)

Answers (1)

david_brandow
Contributor
0 Kudos

I'm not clear on what you mean by "get the attributes for child MBO from parent MBO", can you elaborate on what your expectation is?

There are, in general, two scenarios here, inbound and outbound.  For outbound, you are supplying parent and child (and grandchild) MBOs as parameter values to an operation or object query.  For inbound, you are receiving MBO instance data as a response from an object query.  Which scenario is it you are having difficulty with?  For outbound, there should be all kinds of content in that file in terms of wrapper objects to make using the different MBO types easier to use.  For inbound, you'll be implementing processDataMessage yourself, either by taking the incoming message string and converting it into a WorkflowMessage or by parsing it yourself in whichever manner is most appropriate for your solution.

Former Member
0 Kudos

Hi David,

Thanks for replying, i am not very sure of under which category ( outbound or inbound ) my problem can be categorized.

My problem is i am having these three MOBs ( attached screen shot). In PeopleStream MBO i created a objectqurey, "select * from People p,PeopleStream ps where p.people_id=ps.people_id ",  with name findByPeopleID. Then i right click on the project and select "Generate Hybrid App API.. " , which generates  "hybridApp.js" and "WorkflowClient.xml". Inside these two files and under findByPeopleID i do not have way to get details of people MBO. Only information about PeopleStream MBO is there.

Below is the code snippet from WorkflowClient.xml for PeopleStream_findByPeopleid.

<Action name="PeopleStream_findByPeopleid" sourcescreen="" targetscreen="" errorscreen="" errorlogskey="ErrorLogs" errorlogmessagekey="ErrorLogMessage" errorlogmessageaslistkey="ErrorLogMessageAsList">

        <Methods>

          <Method name="findByPeopleid" type="search" mbo="PeopleStream" package="aaa:1.0" showCredScreenOnAuthFailure="true" >

            <InputBinding optype="none" opname="findByPeopleid" generateOld="false">

            </InputBinding>

            <OutputBinding generateOld="true">                                 

              <Mapping workflowKey="PeopleStream" workflowType="list" mboType="list">

                 <Mapping workflowKey="PeopleStream_people_id_attribKey" workflowType="text" attribName="people_id" mboType="string"/>

                 <Mapping workflowKey="PeopleStream_stream_id_attribKey" workflowType="text" attribName="stream_id" mboType="string"/>

                 <Mapping workflowKey="PeopleStream_people_stream_id_attribKey" workflowType="text" attribName="people_stream_id" mboType="string"/>

              </Mapping>

            </OutputBinding>

          </Method>

        </Methods>

      </Action>

Please share any sample for achieving this.

david_brandow
Contributor
0 Kudos

Are your relationships marked as being composite relationships?

Former Member
0 Kudos

No, these are only bidirectional relationship.

david_brandow
Contributor
0 Kudos

That explains it then. Hybrid apps only support composite MBO relationships.

Former Member
0 Kudos

Thanks David,

It started working after making relationship composite.


Is they any way to debug the code for hybrid.

Also, how to use the _create,update methods??

david_brandow
Contributor
0 Kudos

The following samples deal with debugging:

https://cw.sdn.sap.com/cw/docs/DOC-152609

https://cw.sdn.sap.com/cw/docs/DOC-150957

The generated code should be relatively well documented, but the following samples may help provide additional insight into using the generated MBO JS API:

https://cw.sdn.sap.com/cw/docs/DOC-152841

https://cw.sdn.sap.com/cw/docs/DOC-152686

https://cw.sdn.sap.com/cw/docs/DOC-152664