## EGF examples

## Import of EGF Examples

EGF provides examples accessible in the EGF Examples section from the [File][New][Example...] commands.

Start with the Basic EGF Examples.

Each plugin contains a README file which explains how to play and learn with the different examples.

## EMF Wrapper

### 1. Purpose

Tool: EMF generation + model documentation generation

Learning: understanding 1) how an EGF activity is structured, 2) how to enrich the EMF generation

### 2. Scenario

Create and execute the EMF Wrapper:

- Create a genmodel file from an ecore model file
- On the genmodel, [Right-click][Create EMF Wrapper]
- An fcore file is created
- Open the fcore file
- The production plan examplifies an ordered list of Java task calls with an IN parameter passing
- To execute the factory component, on the factory component or the fcore file, [Right-click][Run EGF Activity...]
- Model, edit, editor APIs are generated, and an html model document in the plug-in with the doc extension

More understanding:

- Add a new generation step: on the production plan, [New Child][Production Plan Invocation], and invoke a factory component or task previously created
- Have a look on a Java task: on a Production Plan Invocation step, [Right-click][Open Activity]. This opens the fcore resource which contains the Java task. On the Java Task node, the value property indicates the Java class path.
- Deep customization: the Java Classes inherits from the EgfEmfAbstractTask which could be redefined in order to have a specific generation behavior.
- Pattern overview: [Right click][Open activity] on the EmfDocGenHtml step. This open the EmfDocGenHtml factory component. Then, visit the patterns which generate the htlm documentation.

## Other examples

- Visit the EGF Wiki, section Tutorial and Use Cases