1 | package de.uka.ipd.sdq.dsexplore.launch; |
2 | |
3 | import org.eclipse.core.runtime.CoreException; |
4 | import org.eclipse.core.runtime.IProgressMonitor; |
5 | import de.uka.ipd.sdq.workflow.ICompositeJob; |
6 | import de.uka.ipd.sdq.workflow.OrderPreservingBlackboardCompositeJob; |
7 | import de.uka.ipd.sdq.workflow.exceptions.RollbackFailedException; |
8 | import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard; |
9 | import de.uka.ipd.sdq.workflow.pcm.jobs.LoadPCMModelsIntoBlackboardJob; |
10 | import de.uka.ipd.sdq.workflow.pcm.jobs.PreparePCMBlackboardPartionJob; |
11 | import de.uka.ipd.sdq.workflow.pcm.jobs.ValidatePCMModelsJob; |
12 | |
13 | public class PerOpteryxJob extends |
14 | OrderPreservingBlackboardCompositeJob<MDSDBlackboard> implements |
15 | ICompositeJob { |
16 | |
17 | //DSECandidateConfiguration candidateConfig; |
18 | |
19 | public PerOpteryxJob(DSEWorkflowConfiguration config, DSELaunch launch) throws CoreException { |
20 | super(); |
21 | |
22 | // 1. Load PCM Models into memory |
23 | this.addJob(new LoadPCMModelsIntoBlackboardJob(config)); |
24 | |
25 | // 2. Validate PCM Models |
26 | this.addJob(new ValidatePCMModelsJob(config)); |
27 | |
28 | //TODO remove step 3 and 5, there should be no need |
29 | //anymore to save the models under a different name. |
30 | //Do I ever need the initial model? |
31 | // 3. Create model files for candidate models |
32 | //this.candidateConfig = createCandidateSetup(config); |
33 | |
34 | // 4. Copy initial instance to separate blackboard partition |
35 | this.add(new MoveInitialPCMModelPartitionJob()); |
36 | |
37 | // create the PCM partition anew but empty |
38 | this.add(new PreparePCMBlackboardPartionJob()); |
39 | |
40 | // 5. Load the candidate models again from updated files |
41 | //this.addJob(new LoadPCMModelsIntoBlackboardJob(candidateConfig)); |
42 | |
43 | // 6. Run Optimisation on Loaded Models |
44 | this.add(new OptimisationJob(config, launch)); |
45 | |
46 | } |
47 | |
48 | @Override |
49 | public void rollback(IProgressMonitor monitor) throws RollbackFailedException { |
50 | super.rollback(monitor); |
51 | /*try { |
52 | this.candidateConfig.getRawConfiguration().delete(); |
53 | } catch (CoreException e) { |
54 | throw new RollbackFailedException("Could not delete launch configuration "+this.candidateConfig.getRawConfiguration().getName(),e); |
55 | }*/ |
56 | monitor.worked(1); |
57 | } |
58 | |
59 | |
60 | } |