Skip to content

Commit

Permalink
Explain how to add a new Specification
Browse files Browse the repository at this point in the history
  • Loading branch information
echebbi committed Mar 17, 2019
1 parent 442099c commit b128b10
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Execution of the workflow created thanks to the diagram editor ([#37](https://github.com/KazeJiyu/ekumi/pull/37))
- User documentation ([#36](https://github.com/KazeJiyu/ekumi/pull/36))
- Customization of new Workflow projects ([#34](https://github.com/KazeJiyu/ekumi/pull/34))
- Simple workflow diagram editor ([#26](https://github.com/KazeJiyu/ekumi/pull/26))
- Launch configurations for Activity ([#20](https://github.com/KazeJiyu/ekumi/pull/20))
Expand Down
56 changes: 56 additions & 0 deletions docs/extend-ekumi/add-specification.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Add a new Specification
#############################

.. important:: This section requires some knowledge about `Eclipse Extension Points <https://www.vogella.com/tutorials/EclipseExtensionPoint/article.html>`_.

What is a specification?
------------------------------

A specification describes a possible representation of a workflow. The main purposes of specifications is allowing new workflow editors.

How to add a new specification?
-------------------------------------

A new one can be defined by contributing to the ``fr.kazejiyu.ekumi.model.specs`` extension point.

It requires one class that implements the ``ActivityAdapter`` interface.

The interface is defined as follows:

.. code-block:: java
:linenos:
public interface ActivityAdapter {
/**
* Returns whether the adapter can turn the given specification into an Activity.
*
* @param specification
* The specification to adapt, may be null.
*
* @return whether the adapter can turn the given specification into an Activity
*/
boolean canAdapt(Object specification);
/**
* Creates an Activity from the given specification.
*
* @param specification
* The specification to adapt.
* @param datatypes
* The factory used to instantiate available datatypes.
* @param languages
* The factory used to instantiate available scripting languages.
*
* @return a new Activity
*/
Optional<Activity> adapt(Object specification, DataTypeFactory datatypes, ScriptingLanguageFactory languages);
}
An ``ActivityAdapter`` is responsible of turning your own specification model into an ``Activity`` so that the framework can execute it.

How to integrate the new specification within the IDE?
------------------------------------------------------------------------------------

.. important:: Feature not implemented yet.
File renamed without changes.
7 changes: 4 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ The behaviour of a task is defined by writting a `runner` using one of the suppo

.. toctree::
:maxdepth: 2
:caption: Extensibility
:caption: Extend EKumi

extensibility/add_scripting_language
extensibility/add_data_type
extend-ekumi/add_scripting_language
extend-ekumi/add_data_type
extend-ekumi/add-specification

0 comments on commit b128b10

Please sign in to comment.