Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Possible Integration Points to Invoke Restful API Call

...

Method 1 - Post Form Submission Processing and JSON Tool

By using Post Form Submission Processing in Form, and "Method 1 JSON Call" earlier, this is the easiest and quickest method. This allows us to invoke any Process Tool & Post Form Submission Processing PluginJSON Tool is one such candidate.

...

  • Upon form submission, form fields will be validated, with its form data stored, then, the "Post Form Submission Processing" will be triggered.
  • Response time of form submission will now include complete execution of the JSON Tool.
  • Imagine that the external JSON API takes longer than expected to respond, the end user will be kept waiting.
  • Depending on the feature of the API call, we would assume that it would return a response to indicate successful execution. For example:-

    Code Block
    languagejs
    titleSample JSON Call Response
    { "success" : "true" }
  • By using this integration point, there's no way to redirect the user to other place/menu when error occurs..

This is to sum things up so far.


SummaryPoint 1 - Post Form Submission Processing + Method 1 - JSON Call
Pros
  1. Quickest
  2. Easiest to Configure
Cons
  1. Increased wait time. Response time includes JSON Tool's turnaround time.
  2. No guarantee of successful JSON call to external system.

Read on to see how we can improve.

Point 2 - Workflow Process

...

Method 2 - Post Form Submission Processing and JSON Tool with Multi Tools

To avoid the waiting time for JSON Tool to finish executing, we can place it under Multi Tools instead.

Image Added

Figure 10

Set the "Run Mode" such that it would execute the process tool (JSON Tool) in a new thread.


Summary
Pros
  1. Quickest
  2. Easiest to Configure
Cons
  1. No guarantee of successful JSON call to external system.

Method 3 - Workflow Process with 

With what we have learned so far, there's still 1 con that we are trying to solve. Let's try to put the form within a process flow in a diagram as below.

Image Added

Figure 11

By using a process flow, we can check the content of the returned JSON call to see if it matches the intended content. For example, we are expecting this reply and have it mapped to a workflow variable.

Code Block
languagejs
titleSample JSON Call Response
{ "success" : "true" }

By doing so, we would be able to redirect back to the same form again and prompting the end user to submit the form again. The potential customer (end user) may not be able to complete the submission process when the external API is not reliable and sees the same form repetitively. This would lead to confusing UI presentation and frustrating user experience.


Summary
Pros
  1. Handles JSON call error and prompt user to submit again to try
Cons
  1. Increased wait time. Response time includes JSON Tool's turnaround time.
  2. Form submission only work end to end when external API service is working.