On Wed, Feb 2, 2011 at 10:48, Alan R Williams <[email protected]> wrote:
> String currentTimeString = System.getProperty("mytime");
> if(currentTimeString == null){
> currentTime = new Date();
> currentTimeString = Long.toString(currentTime.getTime());
> System.setProperty("mytime", currentTimeString);
As Alan points out, future versions of Taverna are likely to 'clear'
those variables between runs (they are also a potential memory leak),
so your initial approach would not be preferable.
I wouldn't rely on system properties either, they would suffer if you
for instance did two workflow runs at the same time, or someone else
got the same idea and put something different in the property.
We're also likely to at some point add system policies/sandboxing to
Beanshell scripts so they would no longer be allowed to modify system
properties.
The best option I would think is to have an initial beanshell script
that determines the timestamp, and then wire that in as an additional
input to the 'real' script. It might clutter up your workflow, but you
could hide this in a nested workflow - just make sure you get the
depth of the nested workflow inputs right to avoid multiple
invocations of the 'timestamper'.
In a way you will then also make sure that all your data flows through
the workflow rather than behind hidden panels - it would be capture in
provenance for instance.
--
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/
Developers Guide: http://www.taverna.org.uk/developers/