220 likes | 418 Views
Palladio Workflow Engine. SDQ Lerngruppe 2010. Motivation. Structure and run activities consisting of a set of actions Make actions reusable and configurable Example: Run simulation Read in Eclipse configuration Load PCM models Check PCM model validity Generate code
E N D
Palladio Workflow Engine SDQ Lerngruppe 2010
Motivation • Structure and run activities consisting of a set of actions • Make actions reusable and configurable • Example: Run simulation • Read in Eclipse configuration • Load PCM models • Check PCM model validity • Generate code • Consists of sub-step • Run simulation • Clean up all side effects Lerngruppe Workflow Engine
Idea: Plug together configurable workflow jobs Couldbeusedforrunning multiple simulationswithoutnewcodegeneration Reusablefor PCM Solver! Load PCM models Check model validity TransformPCMToCodeJob Run simula-tion Configuration Configuration Configuration Configuration Xpand Genera-torJob Xpand Genera-torJob Xpand Genera-torJob … File = repository File = system File = allocation Clean up: Each Job provides a cleanupmethodandthusencapsulatestherequired clean upactions. Example: Delete generatedcode. Lerngruppe Workflow Engine
Concepts • Job • Configuration • ConfigurationBuilder • Blackboard Lerngruppe Workflow Engine
Job • Defines an activity • Can be composed • Three steps • Construct job • Execute job • Call rollback (optional) • Configuration is passed to the constructor • A prepared chain of jobs can be executed without knowledge what jobs they are. Lerngruppe Workflow Engine
Example Composed Job Composite job: Calls all itschildrenwhenexecuted in the order theywereadded packagede.uka.ipd.sdq.workflow.pcm.jobs; publicclassLoadPCMModelsIntoBlackboardJob extendsOrderPreservingBlackboardCompositeJob<MDSDBlackboard> implementsIJob, IBlackboardInteractingJob<MDSDBlackboard> { /** * Constructor of the PCM loader job * @paramconfig A PCM workflow configuration containing the list of URIs * where to find the PCM model files */ publicLoadPCMModelsIntoBlackboardJob( AbstractPCMWorkflowRunConfigurationconfig) { super(); this.add(newPreparePCMBlackboardPartionJob()); this.add(newLoadPCMModelsJob(config)); } } Blackboardinteracting: An MDSD blackboardissetand also setfor all children CompositeJob: Rollback iscalledfor all children Lerngruppe Workflow Engine
Job Inheritance Tree • AbstractCompositeJob • Implements List<IJob> • Allows to add jobs to internal list • Calls each job‘s rollback for rollback • OrderPreservingCompositeJob • Execute: Executes contained jobs in the order they have been added • OrderPreservingBlackboardCompositeJob • Has setBlackboard method • Typed by a Blackboard type • Sets blackboard for contained blackboard interacting jobs before executing them Lerngruppe Workflow Engine
Available (Abstract) Jobs Lerngruppe Workflow Engine
Configuration • Jobs are configured by passing configuration objects • Configuration contains info how to run the job • Examples • Which PCM files to load • How many measurements in SimuCom • Logging level • Which PCM solver to use (LQN, LQNSim, ...) • Which feature annotation to use • The built-in Eclipse ILaunchConfiguration is not used to make the workflows independent of being started from the run dialogue. • E.g. SimuCom is started as a web service in the SLA@SOI project Lerngruppe Workflow Engine
Configuration Hierachy Onlyexampleattributesshown Validation, requireserrormessagetemplatemethod Allowstosetinteractivemode, usercanact upon failures Containsfurther PCM Solver configuration Contains PCM model files URLs Containsconfigforplugingenerationandwhetherexistingcodecanbedeleted Containsfeature model handling ContainsfurtherSimuComconfiguration Lerngruppe Workflow Engine
ExampleEclipse Launch Dialogue Savedaskey-value-pairs in an EclipseLaunchConfiguration Callsyourimplementationof an EclipseLaunchConfigurationDelegate Prof. Max Mustermann - Title
Launch Configuration Delegates • Create configurationfromEclipserunconfig • Calledwhenyouclickrun in Eclipse • Launch methodcalledwithEclipseLaunchConfiguration • ILaunchConfigurationwith Properties • Youneedtosetmonitoring, debuglevels, loggers, … Lerngruppe Workflow Engine
Workflow Launch Configuration Delegates • Abstract delegatehandlesEclipsespecifics • Remainingtemplatemethods • Create workflowjobs • Deriveconfiguration • Just implementthose! Lerngruppe Workflow Engine
DelegateHierachy All Eclipsestuff, onlycreateWorkflowandderiveConfigabstract AddesabstractcreateBlackboard, fixes Blackboard type toMDSDBlackboard. ImplementscreateBlackboardandcreateWorkflowfor PCM models DeriveSimuComconfig Derive PCM Solver config (fixes genericWorkflowConfigurationType) Lerngruppe Workflow Engine
Configuration Builder • Most Jobs require a certain type ofconfiguration • Fillingthesebased on theEclipseinputisencapsulated in Builders • Can bereused in multiple launchdelegates Lerngruppe Workflow Engine
ConfigurationBuilderExample publicclassSimuComWorkflowLauncherextends AbstractPCMLaunchConfigurationDelegate<SimuComWorkflowConfiguration> { @Override protectedSimuComWorkflowConfigurationderiveConfiguration( ILaunchConfigurationconfiguration, String mode) throwsCoreException { SimuComWorkflowConfigurationconfig = newSimuComWorkflowConfiguration(); AbstractWorkflowConfigurationBuilderbuilder; builder = newPCMWorkflowConfigurationBuilder(configuration, mode); builder.fillConfiguration(config); builder = newSimuComLaunchConfigurationBasedConfigBuilder( configuration, mode); builder.fillConfiguration(config); returnconfig; } } Create therequiredconfig Create a builderforthe PCM configpart Letthisbuilderfill in the PCM info (model filenames, …) Create a builderfortheSimuComconfigpart Letthisbuilderfill in theSimuCominfo (maxmeasurements, wheretostore, …) All infoiscontainedhereandcanbereadby a PCM model loaderandbySimuCom Lerngruppe Workflow Engine
Mapping theConfiguration Builderfillsconfiguration Clicking Run extractsconfiguration publicvoidfillConfiguration(AbstractWorkflowBasedRunConfigurationconfiguration) throwsCoreException { SimuComWorkflowConfigurationconfig = (SimuComWorkflowConfiguration) configuration; config.setSimulateLinkingResources(getBooleanAttribute(ConstantsContainer.SIMULATE_LINKING_RESOURCES)); config.setCleanupCode(getBooleanAttribute(ConstantsContainer.DELETE_PLUGIN)); config.setPluginID(getStringAttribute(ConstantsContainer.PLUGIN_ID)); … EclipseILaunchConfigurationeConf: ("simulateLinkingResources" = false) ("clear", true) ("outpath", "...codegen.simucominstance") ("variable", "") ("minimum", "") ("maximum", "") Builderisinstantiatedbydelegate newSimuComLaunchConfigurationBasedConfigBuilder(eConf, mode); Prof. Max Mustermann - Title
Blackboard • Many Jobs require access to model files • Do not just store the URLs in the config • Load files just ones • Keep a blackboard with the model files • Jobs can access data from blackboard by an ID • Concepts • Blackboard interacting Jobs • MDSD Blackboard • EMF Resource Partitions Lerngruppe Workflow Engine
Blackboard Classes Hasseveralpartitionswith an ID and a type T tostoreinformation Type T isfixedto a ResourceSetPartitiontostore EMF model instances For PCM models, an MDSDBlackboardisfilledwithspecialisedPCMPartitionstoconvenientlyaccessthe model files Lerngruppe Workflow Engine
Workflow plugins • Workflow • Main concepts • Eclipse-dependent • Abstract classes with template methods • Launchconfig • Build configurations based on Eclipse launch configs • MDSD • Read in EMF models • OAW and MediniQVT support • PCM • Build PCM configuration • Useful PCM jobs • Tests Lerngruppe Workflow Engine