1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.workflow.pcm.jobs; |
5 | |
6 | import de.uka.ipd.sdq.errorhandling.SeverityEnum; |
7 | import de.uka.ipd.sdq.workflow.OrderPreservingBlackboardCompositeJob; |
8 | import de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard; |
9 | import de.uka.ipd.sdq.workflow.mdsd.emf.CheckEMFConstraintsJob; |
10 | import de.uka.ipd.sdq.workflow.mdsd.oaw.PerformOAWCheckValidation; |
11 | import de.uka.ipd.sdq.workflow.mdsd.validation.ModelValidationJob; |
12 | import de.uka.ipd.sdq.workflow.mdsd.validation.ShowValidationErrorsJob; |
13 | import de.uka.ipd.sdq.workflow.pcm.configurations.AbstractPCMWorkflowRunConfiguration; |
14 | |
15 | |
16 | /** |
17 | * A job for running model validation checks. The job executes both, OCL and oAW check, validations on a PCM model instance. |
18 | * If errors are found, they are reported to the user for corrections. |
19 | * @author Steffen Becker |
20 | */ |
21 | public class ValidatePCMModelsJob |
22 | extends OrderPreservingBlackboardCompositeJob<MDSDBlackboard> { |
23 | |
24 | private static final String PCM_CHECK_FILENAME = "pcm"; |
25 | |
26 | /* (non-Javadoc) |
27 | * @see de.uka.ipd.sdq.codegen.simucontroller.workflow.ISimulationJob#execute() |
28 | */ |
29 | public ValidatePCMModelsJob(AbstractPCMWorkflowRunConfiguration configuration) { |
30 | super(); |
31 | this.setName("Checking PCM model constraints"); |
32 | this.addJob(new PerformOAWCheckValidation( |
33 | LoadPCMModelsIntoBlackboardJob.PCM_MODELS_PARTITION_ID, |
34 | PCM_CHECK_FILENAME, |
35 | AbstractPCMWorkflowRunConfiguration.PCM_EPACKAGES)); |
36 | this.addJob(new CheckEMFConstraintsJob(SeverityEnum.WARNING,LoadPCMModelsIntoBlackboardJob.PCM_MODELS_PARTITION_ID)); |
37 | this.addJob(new ShowValidationErrorsJob(configuration, this.toArray(new ModelValidationJob[]{}))); |
38 | } |
39 | } |