on 01-17-2020 2:35 PM
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
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;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.