Blue Yonder Clear Report Cache

Junaid Abbasi
3 min readNov 12, 2020

--

If you are working on BY WMS (formally JDA / RedPrairie) reporting, you might have faced the issue that your new changes are not being reflected, and system is showing the old report. If you are not working on reporting first time You may also know it is because of report-cache, which needs to be cleared.
Following are the ways we can use to achieve this.

Use clear cache button on screen” Report Maintenance”

This is the standard method to clear report cache, so it is safe.

Unfortunately, sometimes it doesn’t work, and developer doesn’t see his/her changes. Don’t worry let’s move to solution no. 2 😊

JDA Screen “Report Maintenance”

log on to server and remove file from report-cache directory.

If you are using windows server then RDP to server and navigate to the directory %REPORTINGDIR%\report-cache\ and remove “. jrxml” file(s) in this folder. Better is to remove only one you are concerned to but if you clear whole directory still no need to worry about it.

If you are on *nix operating system, then using putty or any other tool navigate to reporting directory which will be $REPORTINGDIR/report-cache/ and use “rm” to remove the concerned file.

But what if you don’t have access to reporting directory and customer on whose system you are working has to follow long approval process to give you access to reporting directory and you want to test your changes without wasting any time.
Here we have solution number 3.

Use Smart MOCA Client

Smart MOCA Client is a really smart MOCA tool which provides a lot of functionalities to make a MOCA developer’s life easy . here you can know more about this tool
If you are already using Smart MOCA Client, then follow below steps
→ press f2
→ navigate to reporting directory
→ report-cache
→ select file right-click
→ remove.
Now if someone has never used this tool then switching to new tool is not so easy. don’t lose hope we still have another solution 😊.

Use MOCA script

input parameters
clear_all →
it will remove all “.jrxml” files from including from sub directories.
report_file_name → if user want to remove a specific file within the report-cache directory . it can be any absolute file path or just filename.

report_cache_dir → report-cache directory path. If not provided it will be @@REPORTINGDIR /report-cache

publish data
where clear_all = 0
and report_file_name = ''
and report_cache_dir = ''
|
get directory separator
|
publish data
where report_cache_dir = nvl(@report_cache_dir, @@REPORTINGDIR || @separator || 'report-cache')
and clear_all = nvl(@clear_all, 0)
|
if (@clear_all = 0)
{
validate stack variable not null
where name = 'report_file_name'
|
if (instr(upper(@report_file_name), '.JRXML') = 0)
{
publish data
where report_file_name = @report_file_name || '.jrxml'
}
|
if (instr(upper(@report_file_name), upper(@report_cache_dir)) = 0)
{
publish data
where report_file_name = @report_cache_dir || @separator || @report_file_name
}
|
find file
where pathname = @report_file_name
}
else
{
[[
searchDir = report_cache_dir
MocaResults res = new SimpleResults();
res.addColumn("filename",MocaType.STRING)
res.addColumn("pathname",MocaType.STRING)
File[] dataDir = new File(searchDir).listFiles()
res = getFileName(dataDir, res)

[res:res]

private MocaResults getFileName(File[] dir, MocaResults res) {
for(File file : dir){
if(file.isDirectory()){
moca.trace("directory :"+file.getName())
getFileName(file.listFiles(),res)
}
else if(getFileExtension(file).equalsIgnoreCase(".jrxml")||getFileExtension(file).equalsIgnoreCase(".jasper")) {
res.addRow();
res.setValue("filename",file.getName())
res.setValue("pathname",file.getAbsolutePath())
}
}
return res;
}

private String getFileExtension(File file) {
String name = file.getName();
int lastIndexOf = name.lastIndexOf(".");
if (lastIndexOf == -1) {
return "";
}
return name.substring(lastIndexOf);
}
]]
|
publish data combination
where res = @res
}
|
remove file
where filnam = @pathname

enjoy :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Junaid Abbasi
Junaid Abbasi

Written by Junaid Abbasi

An experienced BY WMS consultant who enjoys troubleshooting and likes to work on new ideas. reach out to me on LinkedIn: https://www.linkedin.com/in/jabbasi77/

Responses (1)

Write a response