BPM, Workflow, and Case

 View Only
  • 1.  How to get current Proces Portal URL?

    Posted Mon September 28, 2020 09:07 AM

    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
    ------------------------------


  • 2.  RE: How to get current Proces Portal URL?

    Posted Mon September 28, 2020 03:05 PM
    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 -

    1. If you are in a cluster is it returning the cluster node?
    2. 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
    ------------------------------



  • 3.  RE: How to get current Proces Portal URL?

    IBM Champion
    Posted Tue September 29, 2020 03:04 AM
    If you are trying to get it in JavaScript, you can use - 
    location.protocol+"//"+location.host+"/"+"ProcesPortal"​
    If you are trying to get it from server script, then probably this would help to get the host - 
    String(Packages.java.net.InetAddress.getLocalHost().getHostName())​

    ------------------------------
    Atanu Roy
    ------------------------------



  • 4.  RE: How to get current Proces Portal URL?

    Posted Tue September 29, 2020 04:25 AM
    Hi,
    in my experience, when we needed to put Portal URL in an email, we have always used ENV variables for that - as Andrew has mentioned, in clustered environments you would most likely want to put load balancers address instead of having one of the node machine address in the email.

    ------------------------------
    Tomas Dambrauskas
    ------------------------------



  • 5.  RE: How to get current Proces Portal URL?

    Posted Tue September 29, 2020 05:41 AM
    Thanks Guys,

    I think we will use the environment var solution.

    Thx,

    ------------------------------
    ____________________
    Laszlo
    ------------------------------



  • 6.  RE: How to get current Proces Portal URL?

    Posted Wed September 30, 2020 02:17 AM
    There is a very basic built-in feature for sending task notification emails:
    - sending to email addresses configured in user attributes
    - for all tasks (not scoped to apps)
    - users can turn it on or off

    See https://www.ibm.com/support/knowledgecenter/SS8JB4_19.x/com.ibm.wbpm.admin.doc/topics/tadm_portal_email.html or https://www.ibm.com/support/knowledgecenter/SS8JB4_19.x/com.ibm.wbpm.admin.doc/topics/specifying_smtp_server_ports.html

    (You can very likely skip the part about other IBM products that customers used to integrate with Connections and Notes in Before you Begin).

    The automatic emails will contain links to Process Portal - calculated by EndpointService with scenario keys like SERVER_EMAIL_PORTAL_LINK.

    ------------------------------
    Jens Engelke
    ------------------------------