· Apr 9, 2021

Is it possible to extend a Business process ?


I am trying to figure out if we can extend a business process in IRIS. My Use Case is that I am developing RESTful Interfaces and my each REST Interface needs to go through certain processes before getting to the actual action.  

e.g. I have 2 REST Interfaces, GetPatient and GetEncounter. Both of these need to invoke "GetToken" Business Operation to go to the Authentication server to get an authentication token before they go ahead and hit the Business Operation to Get the data i.e. Patient or Encounter.  

Is it possible to create like a "Super" business process that does the call to "GetToken" and extend the two  Business Processes for "GetPatient" and "GetEncounter" from that "Super" Process instead of having to add a <call></call> to "Get Token" in both my business processes individually ?

What I am trying to achieve here is, if I have a new developer tomorrow who is working on "GetReferral" interface, I don't have to tell him to remember to add the call to "GetToken" in his BP. He can just extend his BP from the "Super" BP which would address all the common concerns like "Getting a token" or "basic schema" check etc.  I am keen to hear any other ideas or ways this can be done.



Product version: IRIS 2020.1
$ZV: IRIS for Windows (x86-64) 2020.1.1 (Build 408U) Sun Mar 21 2021 22:04:53 EDT
Discussion (1)2
Log in or sign up to continue

I like your idea of handling this with an extended process - something I had not yet considered. I personally handle this by extending Operations (EnsLib.REST.Operation) to handle specific message types (XData blocks) and then use standard BPLs to manage the appropriate callouts/responses to determine what to do next.

But generally speaking, Processes can be extended with a custom class as well by extending Ens.BusinessProcess and implementing overrides to OnRequest/OnResponse. There's more documentation here:

Defining Business Processes - Developing Productions - InterSystems IRIS Data Platform 2020.4

Interested to hearing how you end up addressing this and suggestions others have as well. I feel like there are many ways to tackle this common need (REST API workflows) so probably several approaches I had not considered.