| 1 | package de.uka.ipd.sdq.workflow.pcm.configurations; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.List; |
| 5 | |
| 6 | import org.eclipse.core.runtime.CoreException; |
| 7 | import org.eclipse.debug.core.ILaunchConfiguration; |
| 8 | |
| 9 | import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowBasedRunConfiguration; |
| 10 | import de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowConfigurationBuilder; |
| 11 | import de.uka.ipd.sdq.workflow.pcm.ConstantsContainer; |
| 12 | |
| 13 | /** |
| 14 | * Builder class which is able to fill the PCM specific parts of a workflow configuration object based on the PCM |
| 15 | * filename configuration tab entries. |
| 16 | * |
| 17 | * @author Steffen Becker |
| 18 | */ |
| 19 | public class PCMWorkflowConfigurationBuilder extends |
| 20 | AbstractWorkflowConfigurationBuilder { |
| 21 | |
| 22 | /** Constructor of this builder |
| 23 | * @param configuration The configuration as created by Eclipse based on the data entered by the user in the |
| 24 | * Eclipse Run Dialog |
| 25 | * @param mode Either "debug" or "run", passed by Eclipse depending on the used dialog |
| 26 | * @throws CoreException |
| 27 | */ |
| 28 | public PCMWorkflowConfigurationBuilder(ILaunchConfiguration configuration, |
| 29 | String mode) throws CoreException { |
| 30 | super(configuration, mode); |
| 31 | } |
| 32 | |
| 33 | /* (non-Javadoc) |
| 34 | * @see de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowConfigurationBuilder#fillConfiguration(de.uka.ipd.sdq.workflow.launchconfig.AbstractWorkflowBasedRunConfiguration) |
| 35 | */ |
| 36 | @Override |
| 37 | public void fillConfiguration( |
| 38 | AbstractWorkflowBasedRunConfiguration configuration) |
| 39 | throws CoreException { |
| 40 | AbstractPCMWorkflowRunConfiguration config = (AbstractPCMWorkflowRunConfiguration) configuration; |
| 41 | |
| 42 | setPCMFilenames(config); |
| 43 | // temporary data location |
| 44 | config.setStoragePluginID(getStringAttribute(ConstantsContainer.TEMPORARY_DATA_LOCATION)); |
| 45 | config.setDeleteTemporaryDataAfterAnalysis(getBooleanAttribute(ConstantsContainer.DELETE_TEMPORARY_DATA_AFTER_ANALYSIS)); |
| 46 | // accuracy analysis |
| 47 | config.setAccuracyInfluenceAnalysisEnabled(getBooleanAttribute(ConstantsContainer.ANALYSE_ACCURACY)); |
| 48 | config.setAccuracyInformationModelFile(getStringAttribute(ConstantsContainer.ACCURACY_QUALITY_ANNOTATION_FILE)); |
| 49 | } |
| 50 | |
| 51 | /** Read the PCM model filenames from this builder's launch configuration |
| 52 | * @param config The configuration object to fill with the PCM model filenames |
| 53 | * @throws CoreException |
| 54 | */ |
| 55 | private void setPCMFilenames(AbstractPCMWorkflowRunConfiguration config) throws CoreException { |
| 56 | |
| 57 | //BRG |
| 58 | List <String> tempList = new ArrayList <String>(); |
| 59 | |
| 60 | tempList.add(getStringAttribute(ConstantsContainer.ALLOCATION_FILE)); |
| 61 | config.setAllocationFiles(tempList); |
| 62 | config.setUsageModelFile ( getStringAttribute(ConstantsContainer.USAGE_FILE) ); |
| 63 | config.setMiddlewareFile ( getStringAttribute(ConstantsContainer.MWREPOSITORY_FILE) ); |
| 64 | config.setEventMiddlewareFile ( getStringAttribute(ConstantsContainer.EVENT_MIDDLEWARE_REPOSITORY_FILE) ); |
| 65 | |
| 66 | } |
| 67 | } |