Journey Manager (JM)
The transaction engine for the platform. |
Form Builder
Platform Developer | All versions
This feature is related to all versions.
Sometimes you may need to invoke a Dynamic Data Service from a form, and you know that it may take some time. Perhaps there is a back-end service that is slow, or perhaps you are calling several different services in order to get your answer.
It might look something like this:
There is two problems with this:
One solution would be to increase the timeouts. However, the timeouts are there for a reason - they are there to protect the application server from having a large number of long-running HTTP connections open. Too many open connections, and the server will eventually run out of resources.
Here are two patterns that may be helpful to work around this problem.
One of the useful things about the web (and Manager) is that services are all asynchronous. So we can modify the above sequence to look something like this:
We've basically made three changes:
Then, in parallel, we will implement another Dynamic Data Service call. This will be on a timer, and will call the Manager server periodically.
The form will call the Polling Service periodically.
The polling service will check the percentage complete, and either;
This solves both problems.
Another way to solve this is to use a blind state machine.
This breaks up the sequence of execution, but does so in a way that the Form is unaware of the details or logic that is occurring on the server. This helps to make sure that the form cannot be compromised by a malicious user.
In this pattern:
A third approach is to use an Enterprise Service Bus or similar architecture. In this case, we would use message queues or similar patterns to "kick off" a long running process. We would then using the polling pattern to discover when the process is complete.
Both the patterns described should be fairly easy to implement, and solve the required problem. The progress polling pattern is arguably superior, because it completely hides the server implementation from the Form.
Next, learn how to view Transact functions.