| 1 | package de.uka.ipd.sdq.codegen.simucontroller.workflow.jobs; |
| 2 | |
| 3 | import org.eclipse.core.runtime.CoreException; |
| 4 | |
| 5 | import de.uka.ipd.sdq.codegen.simucontroller.debug.IDebugListener; |
| 6 | import de.uka.ipd.sdq.codegen.simucontroller.runconfig.SimuComWorkflowConfiguration; |
| 7 | import de.uka.ipd.sdq.workflow.IJobWithResult; |
| 8 | |
| 9 | /** |
| 10 | * Main job for the SDQ workflow engine which will run a SimuComSimulation |
| 11 | * @author Steffen |
| 12 | */ |
| 13 | public class SimuComJob extends AbstractSimulationJob<SimuComWorkflowConfiguration> { |
| 14 | |
| 15 | public SimuComJob(SimuComWorkflowConfiguration configuration, IDebugListener listener, boolean loadModels) |
| 16 | throws CoreException { |
| 17 | super(configuration, listener, loadModels); |
| 18 | } |
| 19 | |
| 20 | public SimuComJob(SimuComWorkflowConfiguration configuration, IDebugListener listener) throws CoreException { |
| 21 | super(configuration, listener); |
| 22 | } |
| 23 | |
| 24 | public SimuComJob(SimuComWorkflowConfiguration configuration) throws CoreException { |
| 25 | super(configuration); |
| 26 | } |
| 27 | |
| 28 | @Override |
| 29 | protected void addSimulatorSpecificJobs(SimuComWorkflowConfiguration configuration) { |
| 30 | // 1. Initialize Failure Type Information |
| 31 | this.add(new DetermineFailureTypesJob(configuration)); |
| 32 | |
| 33 | // 2. Generate the plugin's code using oAW |
| 34 | this.addJob(new TransformPCMToCodeJob(configuration)); |
| 35 | this.addJob(new CreateSimuComMetaDataFilesJob(configuration)); |
| 36 | |
| 37 | // 3. Compile the plugin |
| 38 | this.addJob(new CompilePluginCodeJob(configuration)); |
| 39 | |
| 40 | // 4. Jar the compiled code into a JAR bundle |
| 41 | IJobWithResult<byte[]> buildBundleJob = new BuildPluginJarJob(configuration); |
| 42 | this.addJob(buildBundleJob); |
| 43 | |
| 44 | handleJobExtensions(WorkflowHooks.WORKFLOW_ID_BEFORE_DOCK,configuration); |
| 45 | |
| 46 | // 5. Transfer the JAR to a free simulation dock and simulate it |
| 47 | this.addJob(new TransferSimulationBundleToDock(configuration, debugListener, buildBundleJob)); |
| 48 | } |
| 49 | |
| 50 | public String getWorkflowId() { |
| 51 | return "workflow.extension.simucom"; |
| 52 | } |
| 53 | |
| 54 | } |