The JS-API has a deprecated call for this -
getPortalPageURL, but it only exists inside a TWReport which is also Deprecated. There is a ReST call -
/rest/bpm/wle/v1/systems
which has an item in it "hostname". However I'd worry about several use cases that you would want to test in relying on that -
- If you are in a cluster is it returning the cluster node?
- Is the name being used by the host the same as the URL you are looking for (think F5 or similar, or DNS entry)
Another option, since this is a notification e-mail, if this is notification about a task, you should have the task ID, which means you can get the Task URL, which will have the server name in the URL. You have to use the ReST API to get that as well. You can make these ReST calls on the server using localhost (I believe) which will run wherever the script is running so that should mean you can do this dynamically.
In my experience most BPM solutions don't change server names very often at all because they tend to have other systems calling them, so you'd have to go update all those systems as well. Even if the underlying server hardware is changed out, there is a name in the DNS that resolves to the correct machine since it is easier to update the DNS than it is to track everyone who might be hitting the machine and getting them to update.
------------------------------
Andrew Paier
------------------------------
Original Message:
Sent: Mon September 28, 2020 09:07 AM
From: Laszlo Kertesz
Subject: How to get current Proces Portal URL?
Hi All,
We need to know the the current Process Portal URL to insert it as link into a notification e-mail.
How can we get the Process Portal URL of the currently running environment in Javascript code?
thx,
------------------------------
____________________
Laszlo
------------------------------