cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt in CREATE_DEEP_ENTITY...

Former Member
0 Kudos

Hi all,

I have similar requrement. But I donot have associations and navigations. All i need to create is multiple values.

I have header to item realtion posting only. But the header data is hardcoded in SEGW. (No input from URI). The URI will give only item values, multiple.

Can some one guide me how to create deep entity for the same.  Also please guide me on how to handle to payload in xml format.

One more doubt. Do we need CREATE operation to follow the READ/QUERY operation.

Thanks,

Siva Krishna

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Siva,

I would suggest below approach even though u have hard coded header values.

1. Use SEGW to model ur service.

Create entities and create association & navigation between them with appropriate cardinality as per ur scenario.

In ur use case Header entity to Item entity with cardinality 1 to N

2. Implement Create_Deep_Entity method in DPC_EXT class manually and call ur logic.

3. Use JSON payload which be easy to generate that from UI application.

However XML payload can also be used.

4. JSON Sample payload ->

{

"Id":"01",

"Name":"Ashwin",

"Name2":"Dutt",

"HeaderItem":[{"IdO":"10","NameO":"TestO1"},

{"IdO":"20","NameO":"TestO2"}]

}

Refer below for all the details to accomplish ur scenario.

Regards,

Ashwin

Former Member
0 Kudos

Thanks Ashwin.

I have done the the requirement with create enity now. Able to create one value record.

Now trying to create multiple records.

How will the system know that it has to call CREATE_DEEP_ENTITY. As of now, I have created CREATE_ENTITY already and it is working fine. Do I need to delete it.

Please advice.

Thanks,

Siva Krishna

AshwinDutt
Active Contributor
0 Kudos

Hello Siva,

If u implement Create_Entity u can create one record at any given point of time.

When this is the case how will u create multiple entries? U can do it through operating CREATE in BATCH mode.

In BATCH operation ur BE logic would be called for every single record to create. I mean if u have 2 items ur BE logic is called 2 times in BATCH mode. If n items then n times it will be called.

So i would suggest u to implement as i suggested previously so that u can Create all item level data in one call to BE.

GW understands association & navigation and based on that it will call Create_Deep_Entity.

Ur JSON/XML payload will have navigation property and based on that call is delegated to corresponding method in DPC/DPC_EXT classes.

Now u need not to delete what u have created.

All u need to do now is to create entities newly and follow the steps shown in the document

With that u should be able to implement ur scenario.

Regards,

Ashwin

Answers (0)