1 | package de.fzi.se.accuracy.jobs; |
2 | |
3 | import org.eclipse.core.runtime.CoreException; |
4 | |
5 | import de.uka.ipd.sdq.workflow.IBlackboardInteractingJob; |
6 | import de.uka.ipd.sdq.workflow.LowMemoryFootprintCompositeJob; |
7 | import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard; |
8 | import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractPCMWorkflowRunConfiguration; |
9 | import de.uka.ipd.sdq.workflow.pcm.jobs.PCMWorkflowJobBuilder; |
10 | import de.uka.ipd.sdq.workflow.pcm.runconfig.AccuracyInfluenceAnalysisState; |
11 | |
12 | /**Job to execute accuracy influence analyses. |
13 | * |
14 | * @author groenda |
15 | * |
16 | */ |
17 | public class AccuracyInfluenceAnalysisJob |
18 | extends LowMemoryFootprintCompositeJob<MDSDBlackboard> |
19 | implements IBlackboardInteractingJob<MDSDBlackboard> { |
20 | |
21 | /**Creates a new accuracy influence analysis job. |
22 | * Such a job consists of a set of 'normal' analyses. |
23 | * @param config Configuration. |
24 | * @param jobBuilder Builder for newly created sub-jobs. |
25 | * @throws CoreException On error. |
26 | */ |
27 | public AccuracyInfluenceAnalysisJob( |
28 | AbstractPCMWorkflowRunConfiguration config, |
29 | PCMWorkflowJobBuilder jobBuilder) throws CoreException { |
30 | if (config.isAccuracyInfluenceAnalysisEnabled()) { |
31 | ShowAccuracyInfluenceAnalysisErrorsJob issuesJob = new ShowAccuracyInfluenceAnalysisErrorsJob(config); |
32 | config.setAccuracyInfluenceIssueReceivingJob(issuesJob); |
33 | AbstractPCMWorkflowRunConfiguration newConfig; |
34 | for (AccuracyInfluenceAnalysisState state : AccuracyInfluenceAnalysisState.values()) { |
35 | newConfig = config.getClone(); |
36 | newConfig.setAccuracyInfluenceAnalysisState(state); |
37 | this.add(jobBuilder.buildJob(newConfig)); |
38 | } |
39 | // display accuracy influence analysis issues |
40 | this.add(issuesJob); |
41 | } else { |
42 | this.add(jobBuilder.buildJob(config)); |
43 | } |
44 | } |
45 | } |