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
Original Message:
Sent: Wed June 12, 2024 03:43 AM
From: Yannick Martin
Subject: Process Center - Change Toolkit REST server definition
Hi,
we face always the same problem when we transfer process applications with its dependent toolkits from a process center to another.
In fact we have 10 process centers, one per customer.
In several toolkits we have define a REST server to access our customer's data.
As each REST Server has to access the right customer endpoint, the hostname defined in the REST server has to be changed.
When we deploy the process application on a process server, we usually change the hostnames thru the Process Admin interfance.
But when we deploy the process application and its toolkits on a process center, we have to create a new snapshot of all toolkits and process applications after changing the REST Server hostnames in Process Designer.
Is there a way to achieve the REST server properties update thru APIs for the Tip version or directly in the toolkit definition without creating a new snapshot ?
Our last solution were to change it directly on database, if possible.
Thanks for help
Yannick
------------------------------
Yannick Martin
------------------------------