# Why Should I Need Dark Feature Processing?

Dark feature processing can be used to modify diagram data as well as business data through existing Graphiti features, without the need to have any Graphiti editor or viewer being open.

# What Do I Have to Do to Process My Features “Dark”?

You just have to create the suitable diagram type provider (DTP) and feature provider combination for the diagram to be modified. The service class ExtensionManager provides some useful methods: createDiagramTypeProvider(IDiagram) can be called to receive a DTP loaded with all the stuff needed to process your existing features. But keep in mind that these features can not show any kind of UI because there is no real visible editor running.

# Pitfalls

- Dark processed features really have to be dark! No pop up dialogs, please…
- No selection
- No (auto) direct editing

So eventually you have to prepare your features to fit these needs.

# Example

An example for dark feature procession can be found in the final version of this tutorial plugin as it is contained in the SDK download of Graphiti. The AddAllClassesCommand uses this method to add all existing classes of the current project to a new diagram. The functionality is triggered from the context menu entry Create Diagram with all Classes on the EClasses node in the project explorer. For the complete functionality have a look into the class CreateDiagramWithAllClassesHandler and the registration of the handler and the command in plugin.xml. Besides an additional reference to the plugin org.eclipse.emf.transaction is needed to make the extension compile. The coding can be found in the SDK download of Graphiti. The two classes can be found in the package org.eclipse.graphiti.examples.tutorial.handlers.