Skip to main content
Jump to: navigation, search

MoDisco/Components/Workflow/Documentation/0.7

MoDisco
Website
Download
Community
Mailing ListForums
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse SourceProject Set File

Requirements

To use the plug-in you need:

  • JDK 1.5 or above
  • Eclipse Modeling Ganymede SR2 (Version: 3.4.2) because it incorporates JET, QVTo and ATL.

Install MoDiscoWorkflow

Install instructions

You could download an archived site or use the update site of MoDisco .

Dependencies errors

Because MoDisco Workflow has a driver mechanism to manage external components, each driver has a dependency to one handled component. To install a dedicated driver properly, the handled component shall have been installed. It is a reason why when you click on the "Install..." button, you can have dependency errors. In that case, you could install the missing packages at the origin of the errors or deselect the dedicated driver. Then restart the installation process.

Example of dependencies errors

If you didn't have dependency errors, click on the "Finish" button. The installation of the MoDiscoWorkflow plug-in and its selected drivers is finished. Congratulations!

Build your MoDiscoWorkflow

The user interface of MoDiscoWorkflow

To reach the MoDiscoWorkflow plug-in user interface, you have to click on this button -MoDiscoWorkflow-Execution.png and then click on the “Run Configuration” menu.

User interface of MoDiscoWorkflow

You can now build your MoDiscoWorkflow. Various properties are proposed to you:

  • Add a MoDiscoWork in the MoDiscoWorkflow from the “New…” button
  • Edit a MoDiscoWork from the “Edit…” button
  • Remove a MoDiscoWork from the “Remove” button
  • Move a MoDiscoWork up in the MoDiscoWorkflow using the “Up” button
  • Move a MoDiscoWork down in the MoDiscoWorkflow using the “Down” button
  • Load a MoDiscoWork in the MoDiscoWorkflow from the “Load…” button

Create a MoDiscoWork

After having clicked on the "New..." button, you must choose the type of transformation you want to add. According to the installed drivers, you have more or less choice.

Choice of transformation type

After choosing the type of MoDiscoWork, click on the "Next" button to configure your transformation. For the example, we have chosen "Transformation Java". Now, you can configure your MoDiscoWork of java type.

Add a MoDiscoWork of java type

Edit a MoDiscoWork

To edit a MoDiscoWork, click on the “Edit…” button after selecting the desired MoDiscoWork. A new wizard opens to configure the selected MoDiscoWork.

Remove a MoDiscoWork

Remove a MoDiscoWork from the MoDiscoWorkflow

To remove a MoDiscoWork, you must select a MoDiscoWork in the MoDiscoWorkflow and click on the "Delete" button. A new window opens proposing these various choices:

  • "Delete from launcher": To delete the MoDiscoWork selected in the MoDiscoWorkflow and its associated launcher.
  • "Delete from workflow": To delete the MoDiscoWork selected in the MoDiscoWorkflow
  • Cancel: To cancel

Load a MoDiscoWork

Load a MoDiscoWork

When you want to load a launcher (MoDiscoWork) in the MoDiscoWorkflow, click on the "Load…" button. A new window opens proposing every launcher present in the workspace which has a driver defined for the type of launcher. To load a MoDiscoWork, select a launcher and click on the “Finish” button.

Run your MoDiscoWorkflow

When you finished building your MoDiscoWorkflow, click on the “Run” button. An error window opens if one or more MoDiscoWork are not valid. Every MoDiscoWork must be valid to run the MoDiscoWorkflow.

Create a driver for MoDiscoWorkflow

"driver" extension point

"driver" extension point architecture

The MoDiscoWorkflow plug-in proposes an extension point named "driver". This extension point contains a sequence one..one of "driverUI" extension point and "execution" extension point. The "id" field is required. It allows binding both extension points.

===="driverUI" extension point====" This extension point defines:

  • A field name: This name will be used to the list of transformation types.
  • A field icon: It’s driver icon path.
  • A field class: The class has to implement this interface: "org.eclipse.gmt.modisco.workflow.DriverInterface".

"execution" extension point

This extension point defines:

  • A field class: The class has to implement this interface: "org.eclipse.gmt.modisco.workflow.ExecutionInterface"

Papyrus driver example

In this example, we are creating a new driver for launcher of papyrus. Follow these steps:

  • Create a new plug-in project
  • Name this project "org.eclipse.gmt.modisco.driver.papyrus"
  • Add the "com.cea.papyrus.extensionpoints.transformation" plug-in to the list of plug-ins required for the operation of this plug-in (dependencies)
  • Create a class ("LaunchDriverPapyrus.java") which implements the interface "org.eclipse.gmt.modisco.workflow.DriverInterface" (below).
  • Create a class ("TransformationExecute.java") which implements the interface "org.eclipse.gmt.modisco.workflow.ExecutionInterface" (below).
  • Add a new extension named "org.eclipse.gmt.driver"
  • Name the "id" field of extension point "idPapyrus"
  • For the "driverUI" point extension:
    • Name the "name" field "Papyrus Generation"
    • Indicate the papyrus icon's path in the plug-in
    • Indicate the class which implements the interface "org.eclipse.gmt.modisco.workflow.DriverInterface"
  • For the "execution" point extension:
    • Indicate the class which implements the interface "org.eclipse.gmt.modisco.workflow.ExecutionInterface"
Driver Papyrus example ("driverUI" extension point)
Driver Papyrus example ("extension" extension point)

package org.eclipse.gmt.modisco.workflow.driver.papyrus.ui;
 
import java.util.List;
 
import org.eclipse.gmt.modisco.workflow.DriverInterface;
import org.eclipse.gmt.modisco.workflow.driver.papyrus.Constant;
import org.eclipse.gmt.modisco.workflow.ui.common.MoDiscoWorkParameter;
 
public class LaunchDriverPapyrus implements DriverInterface {
 
	@Override
	public String getTypeLaunchConfig() {
	     return "com.cea.papyrus.extensionpoints.transformation.launchConfigurationType";
	}
}

The "com.cea.papyrus.extensionpoints.transformation.launchConfigurationType" string is the papyrus launcher type. The launcher type is present in the ".launch" file. This file is created during the creation of a new launcher of this type

package org.eclipse.gmt.modisco.workflow.driver.papyrus.execution;
 
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.gmt.modisco.workflow.ExecutionInterface;
import com.cea.papyrus.extensionpoints.transformation.launch.LaunchTransformationDelegate;
 
 
public class TransformationExecute implements ExecutionInterface {
 
	@Override
	public void launch(ILaunchConfigurationWorkingCopy configuration, ILaunch launch) {
		try {
			LaunchTransformationDelegate delegate = new LaunchTransformationDelegate();
			delegate.launch(configuration,ILaunchManager.RUN_MODE, launch,new NullProgressMonitor());
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
}

It is necessary to use the delegate to execute the configuration.

Current limitations

Right now, it's not possible to bind the parameters between components. Furthermore, the workflow is executed in a sequential way.

Wishlist

  • Use the engine of MWE to launch a workflow.
  • Use the last version of MWE in MoDiscoWorkflow.
  • Export a MoDiscoWorkflow as a new discoverer project (Java plug-in project).

Back to the top