Hybrid App DCN With Payload

Understand how to construct a Hybrid App DCN with payload message.

This example illustrates data flow of a WF-DCN with payload using an SAP EIS:


hwc_dcn_with_payload
  1. When the EIS has new or modified data to push to SAP Mobile Server, it initiates an HTTP request to the WF-DCN URL. The WF-DCN message contains the new or changed data object.
  2. When the WF-DCN message reaches SAP Mobile Server, the Hybrid App engine evaluates the matching rule against all registered Hybrid Apps. If a matching rule matches this message, the Hybrid App server starting point for that Hybrid App is triggered to process the message.
  3. The data object included in the WF-DCN message is applied to the MBO CDB table by inserting new records or updating existing records.
  4. The Hybrid App server-initiated starting point extracts parameter values from the message body and triggers the MBO object query to retrieve the newly inserted or updated record.
  5. The Hybrid App engine converts the MBO data and WF-DCN message into a Hybrid App notification, then pushes it to the device mobile inbox using SAP messaging (MOCA).

MBO cache group policy

The cache group policy of MBOs used in WF-DCN with payload must be DCN.

Message format

The message format of the WF-DCN message with payload is:
{”id”:””,”op”:””,”subject”:””,”to”:””,”from”:””,”read”:””,”priority”:””,”body”:””,
“data”:[{”id”:””,”pkg”:”Package”,”messages”:[{”id”:”2”,”mbo”:”MBO”,”op”:”:upsert”,
”cols”:{”attribute1”:”value1”,”attribute2”:”value2”,”attribute3”:”value3”}}

The message must contain e-mail information: subject, to, from, and so on, and include the MBO package name and version, MBO name, attribute name, and attribute value. The message can include multiple MBOs. For example:
{”id”:”1137”,”op”:”:upsert”,”subject”:”PERF0111’s Leave Request”,
”to”:”PERF0111”,”from”:”Leave Work Flow”,”read”:”false”,”priority”:”true”,
”body”:”MATCH:SUP_MWF,TaskID:TS97200149, WIID:1470577, USER:PERF0111*#END#*”,
”data”:[{”id”:”dcbtest”,”pkg”:”sup_mwf:1.2”,”messages”:[{”id”:”2”,”mbo”:”Workitem”,
”op”:”:upsert”,”cols”:{”WORKITEM”:”1470577”,”USERNAME”:”perf0111”,”DESCRIPTION”:”cc”,
”DECISION”:”test”}},{”id”:”6”,”mbo”:”Alternatives”,”op”:”:upsert”,
”cols”:{”WORKITEM”:”1470577”,”USERNAME”:”perf0111”,”PKEY”:”01”,”PVALUE”:”Ap”}}]}]}