Jump to content

Add a Sleep/wait Custom task in the Spotfire Automation Job Builder


M G

Recommended Posts

Hi all,

I have a dashboardwhich loads with no data and user is asked to choose parameters and click Submit to fetch the data on the fly (which takes approximately 5 minutes). I need to automate the generation of the PDFs for this dashboard.

Right now, I added 2 tasks in my Automation Job Builder :

1. Open Analysis from Library :I am able to pass the Parameters using the configuration block and then running some scriptsto click the Button. EDIT : I was able to pass the parameters/configuration blockthrough the Automation Services Job Builder UI, but when I call its service bat file for autosys (Spotfire.Dxp.Automation.ClientJobSender.exe ) , it gives me an error saying : The current threaddoes not have an open read transaction. Any thoughts on this please I have pasted the whole error in the comments. - THIS IS RESOLVED. SEE COMMENTS!

2. Export to PDF : Exporting the PDF based on the users requirements for all the pages.

The problem is thatafter execution of the 1st step, it doesn't wait for the data loadto finish (~5 minutes as mentioned earlier)and proceeds to export the PDF leading to blank data in the reports generated. So, I am trying few things like adding dummy tasks or putting in sleep timer but exe doesn't recognize this.

Has anybody faced this type of problem. If yes, can you please help me out here to create Custom Job builder tasks or something on the same lines Any help is appreciated.

Regards

Link to comment
Share on other sites

I havent done this completly in Automation Services.

You can build the Automation services job for Open Analysis from Library what you have right now.

Call this job via Autosys or other scheduling tool and upon completion, you can call the export to pdf job via Autosys.

This wayyou canmake sure that data is available in the first Autosys job.

Thanks

Link to comment
Share on other sites

Thanks for the response johnjustus. Although we need something Robust, but I think this is a good idea to try out. I understand that you have created two separate jobs for the tasks I listed above. But, my question is would it allow the data to retain in spotfire memory and export the correct data 

 

Thanks

Link to comment
Share on other sites

Hi johnjustus, I had tried it out but it gives an error that No Analysis is loaded. Here is what I did : 1. Created an autosys job with task as "Open Analysis from Library" with configuration block and put it on sleep for 5 mins (for it to load).2. Created a successor job with task as "Export To PDF" with PDF config. First job runs fine. But, 2nd job gives an error in the log below: Error executing job:

Failed

Task 2 Export to PDF failednNo analysis loaded. Can you please give me an idea on how you are doing it exactly or if I am doing anything wrong Thanks

 

Link to comment
Share on other sites

Hi johnjustus,

 

If I try that, it just exports the PDF with stale/blank data without waiting for the data retrieval.

 

That's the reason why I want to split it in 1st place or maybe, write a custom task to add wait for the next task to execute.  What are your thoughts on it 

 

 

 

Thanks

Link to comment
Share on other sites

hmm, I know that every job should have open from Analysis by default.

In your case, the first task brings in the data and the pdf task should have the data. This is bizzare.

May be some thing to do with configuration block limitation itself, I am not sure...

Can you try cache the report by passing in the parameters from configuration block so the data will be on memory.

Link to comment
Share on other sites

Yes it always say there is no analysis open, maybe there are 2 instances open. What used to happen in your case  Did it work 

 

By caching report using config block, you mean can I pass the Configuration block in XML Yes and No. When I pass the parameter using configuration block in XML and execute the Job Locally, it works fine. But, when I execute the Job on the Server, it returns an error saying  "The current thread does not have an open read transaction". I have pasted the error in a comment here if you want to see the whole thing.

 

Any reason why this would be happening  Thanks for the help.

Link to comment
Share on other sites

Mine was just an cached report with out parameters. Then I open the Analysis as first task and export to pdf as second task in the same Job. I cache the report from Autosys using updateservice webservice.

 

Your Job should work. May be you can test with out configuration block to rule out the possibilities.

 

If you are getting no where with this, may be open an support case with Tibco..

Link to comment
Share on other sites

Hi,

 

 

 

The Configuration Block issue using ClientSender.exe is resolved. All I had to do was to add the IronPython DLLs to the spotfire Automation Folder and update AddIns.xml using approach mentioned in the article below : 

 

https://community.spotfire.com/questions/retrieving-values-analysis-using-automation-services

 

Now, the issue comes back to the waiting for the Load to happen. 1st option was to create to separate Autosys jobs - one to load analysis and one to Export the PDF but it seems with every job run, new session is created. Hence, 2nd job fails there (Any suggestions here )

 

Also, then I tried putting 2 tasks in one job, and using the option useSynchronousWebService option in the Batch file while running the automation xml job. But, it doesn't really wait for the 1st job to finish and proceeds to Export to PDF option. The IronPython Refresh Happens at the end. Is this expected 

 

 

 

If nothing helps, then I will open Tibco Support ticket.

 

 

 

Thanks

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...