Extending Data Change Notification to Mobile Workflow Clients

Mobile Workflow data change notification (WF-DCN) requests enable you to process the general DCN request and send notification to the device to keep the workflow application synchronized with the enterprise information system (EIS) when a change to the EIS occurs.

DCN messages targeted for MBOs used in workflow applications (WF-DCN), uses similar syntax as general DCN, with these differences:

WF-DCN format

The WF-DCN request is a JSON string consisting of these fields: workflow engine convert MBO data and WF-DCN message into workflow email, and push it to device mobile inbox
  1. Operation name(op) :upsert or :delete– same as regular DCN.
  2. Message ID (id) of the Mobile Workflow – used for correlation (a :delete for a previously submitted request with :upsert is possible)
  3. Username (to) – the Sybase Unwired Platform user name. For the user to be recognized by WF-DCN, the device user should first have established communication using the activation mechanism in Sybase Control Center.
    Note: The "To" field must match the Unwired Platform user name—not the user name used to register the device.
  4. Subject (subject) – subject of the workflow message.
  5. Originator <from> – who the workflow message is from.
  6. Body of the workflow message <body> – it can embed customized information.
  7. <received> – received time of the Mobile Workflow message.
  8. <read> – whether the Mobile Workflow message is read.
  9. <priority> – whether the Mobile Workflow message has a high priority.
  10. List of dcn request <data> – JSON format string.
Example DCN request in JSON format:
{
"op":":upsert",
"id":"WID123",
"to":"SUPAdmin", 
"subject":"Trip request approval required",
"from":"user321",
 "body":"This is a message just used to do a test",
"received":"2009-03-29T10:07:45+05:00",
"read":false,
"priority":true,
"data":
   [
     {"id": "1",
     <general dcn request>
      }
      …
     {"id": "4",
     < general dcn request>
      }
   ]
}

Mobile Workflow DCN request flow

WF-DCN with and without payload differ slightly, but the general flow is similar for each. When the WF- DCN request is received, Unwired Server gets the cmd value from the request first, and:

  1. Unwired Server invokes preProcessFilter if the DCN filter is specified.
  2. Unwired Server receives a raw HTTP POST body to generate and return a WF- DCN request message object.
  3. The JSON format string is parsed into a WF-DCN request object.
  4. The DCN request in the Mobile Workflow message object is parsed and those within the scope of a single transaction per DCN request object in the array are executed. Results are recorded for a report after completing the WF-DCN request.
  5. From the CDB, the server looks up all users assigned to the indicated workflow package in the “to” attribute of the Mobile Workflow message, then matches them with the receiver list.

    For every receiver, Unwired Server generates multiple workflow messages (all workflow messages are created within one transaction), one per device identified (one user might have multiple devices), and then sends them to the JMS queues.

    The lookup of the logical id is performed by combining the username in the “to” list to the “securityProfile” specified in the HTTP POST REQUEST URL parameter list.

  6. If any errors occur in step four, step five does not execute. If any errors occur in step five, step five is not committed. If any errors occur in either of those steps, an HTTP 500 error is returned.
  7. Unwired Server invokes the postProcessFilter, if specified.
  8. If no errors occur, Unwired Server returns success to the caller HTTP 200 with the body of the JSON string (or any opaque data returned from the postProcessFilter) of the WF-DCN Result. Otherwise, Unwired Server returns an HTTP 500 error with the body of the JSON log records.