Original Message:
Sent: Fri June 14, 2024 09:07 AM
From: Henry Schenau
Subject: Process Center - Change Toolkit REST server definition
Yannick,
We are using the different solutions Don described as well, dependent upon the service we are calling.
Using this JavaScript, you can overrule (some) properties defined in the REST server definition (by your own ENV of other settings)
Consider the following sample client code:
var request = new BPMRESTRequest();
request.externalServiceName = "MyServiceName";
request.operationName = "myOperation";
request.endpointAddress = tw.local.inputEndpointAddressDefinedInCallingProcessApp; // Overrule the hostname with an input variable
request.parameters = {};
request.parameters.id = tw.local.inputId;
request.httpHeaders = {"Content-Type": "application/json",
"Accept": "text/plain"
};
var response = tw.system.invokeREST(request);
tw.local.outputResponseObject = JSON.parse(response.content);
I hope this inspires you.
Regards,
Henry
------------------------------
Henry Schenau
------------------------------
Original Message:
Sent: Thu June 13, 2024 04:44 AM
From: Yannick Martin
Subject: Process Center - Change Toolkit REST server definition
Hi Don,
thank for your answer.
I understand that you suggest to use environment variables. How to define the hostname from a REST Server (see picture) with an environment variable ?
Remark :Thus the environment variables aren't updateable directly in Process Center like on runtime environments (thru Process Admin).
BR
Yannick
------------------------------
Yannick Martin
Original Message:
Sent: Wed June 12, 2024 07:16 AM
From: Don Williams
Subject: Process Center - Change Toolkit REST server definition
Hello Yannick-
So you have a toolkit with services that utilize REST endpoints and the hostname for each endpoint depends on the process application? Would you be able to modify the service(s) in the toolkit to accept the REST endpoint hostname as an input variable and then the process app contains an environment variable for the hostname which is passed into the toolkit REST service? This would allow you to set the hostname for each deployed snapshot separately. If there are a number of references to the toolkit service in the process app, you could even create a wrapper at the process app level which passes in the environment variable for you (so the environment variable is only referenced in one place), and then just utilize the wrapper service in all CSHS, coaches, system services, etc where it is used.
Let me know if any part of this approach is unclear or wouldn't work for you for some reason.
Thanks -Don
------------------------------
Don Williams