cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Redwood BPA - Report with Permalink

0 Kudos

Hello,

We have a report that uses a custom SQL statement to retrieve values from the job table.
We would like to include a permalink on the report HTML output, which points to a specific job which is included in the report output selection.
Looking through the documentation, the report definition can contain a formatting for the columns, using "Permalink", but we are unable to find an example of how this can be used.

We have tried putting out the UniqueId and JobId for the job, and setting the column to "Permalink" or "Business Key" (just to test) and we do not notice any difference when in the Report Preview.

How can we output a link to the job whose details are included in the report?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

paul_murgatroyd
Explorer
0 Kudos

I have a similar usage where I want to include the link to the job in an e-mail

I wrote a Custom Library (Custom_URL) with a REL Function to generate the Permalink from the Job ID.

You have one REL ENtry point, getPermaLinkURL, which takes in two parameter. The first being the JobId, the second being what PermaLink URL you want

In your report, you'd create a new column called "PermalinkURL" or something, and in the values Column you would call the REL Function

=Custom_URL.getPermaLinkURL(Job.JobId,'Show')

package com.redwood.scheduler.custom.url;

import com.redwood.scheduler.api.model.*;
import com.redwood.scheduler.api.model.enumeration.*;
import com.redwood.scheduler.api.exception.*;
import com.redwood.scheduler.api.scripting.variables.ScriptSessionFactory;


public class relFunctions
 {
  public String getPermaLinkURL ( String pJob, String pPurpose ) 
      throws com.redwood.scheduler.api.exception.UnsupportedPermaLinkException
  { 
   // The Job that we want the PermaLink for
   Long jobId = new Long(pJob);
   // The type of PermaLink to return.
   // One of:- Create, Diagram, Edit, List, Output, Show, Submit
   PermaLinkPurpose PLP = PermaLinkPurpose.valueOf(pPurpose);
   SchedulerSession ses = ScriptSessionFactory.getSession();
   String Url = ses.getJobByJobId(jobId).getUrl(PLP);
   return Url;
  }
}


0 Kudos

That's a lovely solution!
Thanks.

0 Kudos

Just 1 thing to add to the above. When implementing the Library Source, in BPA 9, I found I needed to restart the SAP NW stack before the report was able to see the new class.
The report could see the REL function, but when it tried to use it, it just returned an invalid method error.
Strange, but true.
Overall, this worked perfectly. Thanks again.

Answers (0)