Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » ValidTriggers of a Task
ValidTriggers of a Task [message #1708504] Thu, 17 September 2015 08:28 Go to next message
Maksim Melnik is currently offline Maksim MelnikFriend
Messages: 52
Registered: August 2015
Member
This Thread is a follow from: https://www.eclipse.org/forums/index.php/t/1069773/

I decided to create a new thread because my questions have nothing to do with old topic name anymore. Thus , I think it will be more usefull for other users if i create a new topic.

So, my problem is that my task is automatically included into startup task, so it is executed each time when i start my eclipse , instead of just once , after the installation. The answer from Eike was to either use ValidTriggers or :

1) Remember a flag somwhere under .metadata to remember the fact that a one-time task has successfully executed. See
ProjectSetImportTaskImpl.Helper.isNeeded() for an example with more fine-grained state that is remembered.

2) Leave more expensive computation to the MANUAL trigger and skip the STARTUP trigger completely. See
P2TaskImpl.isNeeded() for an example of a task that's only needed at startup if from the explicit top-level requirements
it's obvious that software is missing (i.e., it omits expensive remote queries for update searches).

3) Combinations of the two approaches 1 and 2.


Is it possible to controll the startup execution of the task with ValidTriggers ?
What are the possible values of the ValidTriggers ?


So far i only have one annotation: "triggers -> STARTUP MANUAL"
Re: ValidTriggers of a Task [message #1708515 is a reply to message #1708504] Thu, 17 September 2015 09:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Maksim,

The possible values are from the enum org.eclipse.oomph.setup.Trigger.
You might exclude startup trigger, but then the task would not run
automatically at all when the IDE is launched for the first time. Best
you come up with a good implementation of isNeeded.

On 17/09/2015 10:28 AM, Maksim Melnik wrote:
> This Thread is a follow from:
> https://www.eclipse.org/forums/index.php/t/1069773/
>
> I decided to create a new thread because my questions have nothing to
> do with old topic name anymore. Thus , I think it will be more usefull
> for other users if i create a new topic.
>
> So, my problem is that my task is automatically included into startup
> task, so it is executed each time when i start my eclipse , instead of
> just once , after the installation. The answer from Eike was to either
> use ValidTriggers or :
> 1) Remember a flag somwhere under .metadata to remember the fact that
> a one-time task has successfully executed. See
> ProjectSetImportTaskImpl.Helper.isNeeded() for an example with more
> fine-grained state that is remembered.
>
> 2) Leave more expensive computation to the MANUAL trigger and skip the
> STARTUP trigger completely. See
> P2TaskImpl.isNeeded() for an example of a task that's only needed at
> startup if from the explicit top-level requirements
> it's obvious that software is missing (i.e., it omits expensive remote
> queries for update searches).
>
> 3) Combinations of the two approaches 1 and 2.
>
>
> Is it possible to controll the startup execution of the task with
> ValidTriggers ?
> What are the possible values of the ValidTriggers ?
>
>
> So far i only have one annotation: "triggers -> STARTUP MANUAL"


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ValidTriggers of a Task [message #1708538 is a reply to message #1708515] Thu, 17 September 2015 10:51 Go to previous message
Maksim Melnik is currently offline Maksim MelnikFriend
Messages: 52
Registered: August 2015
Member
Thank you for your help,
i solved the problem by simply creating a .txt file in the .metadata folder on the first run and then checking if the file exists on the next runs
Cheers,
Maksim
Previous Topic:How to build Oomph installer executable?
Next Topic:Package Explorer: Top Level Elements
Goto Forum:
  


Current Time: Fri Dec 06 17:17:56 GMT 2024

Powered by FUDForum. Page generated in 0.03405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top