Skip to main content
19-Tanzanite
July 9, 2025
Solved

Adding URL Variable to Change Activity JSP

  • July 9, 2025
  • 2 replies
  • 727 views
I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.2.8

How do I put an URL variable on a custom JSP page for a change activity? When I put the variable, it comes out as text.
    Best answer by HelesicPetr

    Hi @BrianToussaint 

    It is very simple. The url can not contain a space character 

    you have to replace the space character with a encoding character %20

    check following link https://www.w3schools.com/tags/ref_urlencode.ASP

     

    PetrH

    2 replies

    avillanueva
    23-Emerald I
    23-Emerald I
    July 9, 2025

    I think you have assign a data utility to that variable for it to render as a hyperlink.

    HelesicPetr
    22-Sapphire II
    22-Sapphire II
    July 17, 2025

    Hi @BrianToussaint 

    I use a following code to build the a download URL for the URL link variable in the workflow that is set this object in the variable URL type that I show in the task page.

    //URL urlSet = ContentHelper.service.getDownloadURL(orderDocument, apData);
    String serverURL = AttachmentsDataUtilityHelper.getBaseURL();
    String urlString = serverURL + "/servlet/AttachmentsDownloadDirectionServlet?oid=OR:";
    
    urlString = urlString + contents.getPersistInfo().getObjectIdentifier().getStringValue();
    urlString = urlString + "&cioids=";
    urlString = urlString + apData.getPersistInfo().getObjectIdentifier().getStringValue();
    urlString = urlString + "&role=";
    urlString = urlString + apData.getRole();
    
    URL urlSet = null;
    try
    {
    	urlSet = new URL(urlString);
    } catch (MalformedURLException e)
    {
    	e.printStackTrace();
    }

     

    the urlSet is the final object that is saved in a wokrflow variable and then I show this variable in the task activity page

     

    hope this can help

     

    PetrH

    19-Tanzanite
    July 22, 2025

    @HelesicPetr, the  problem that I am running into is that I have a space and it stops the link at the space and then shows the rest but it isn't part of the link.

     

    String PowerBI_Lnk = PowerBI_WU_Begin + " " + wtpartList;

    HelesicPetr
    22-Sapphire II
    22-Sapphire II
    July 22, 2025

    Hi @BrianToussaint 

    It is very simple. The url can not contain a space character 

    you have to replace the space character with a encoding character %20

    check following link https://www.w3schools.com/tags/ref_urlencode.ASP

     

    PetrH