Add a new Scripting Language¶
Important
This section requires some knowledge about Eclipse Extension Points.
What is a scripting language?¶
A scripting language is a language that can be used to specify the behaviour of a task. Concretely, a language is a parser that can:
- Instantiate an
Activity
from a given String - Create a String from an existing
Activity
.
It is hence responsible of serializing and deserializing Activities so that they can both be persisted and executed.
How to add a new scripting language?¶
A new one can be defined by contributing to the fr.kazejiyu.ekumi.core.languages
extension point.
It requires one class that implements the ScriptingLanguage
interface.
The interface is defined as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | public interface ScriptingLanguage {
/**
* Returns a unique id identifying the language.
* @return a unique id identifying the language
*/
String id();
/**
* Returns a human-readable name of the language.
* @return a human-readable name of the language
*/
String name();
/**
* Turns a runner written with the language into a EKumi {@link Runner}.
*
* @param identifier
* Uniquely identifies the runner to resolve.
* Must not be {@code null}.
* @param context
* The context of the {@link Execution}. Can be null if the execution
* does not provide any context, or if the Runner is not resolved in
* the context of an execution.
*
* @return a runner that can be handled by EKumi.
*
* @throws ScriptLoadingFailureException if the script cannot be loaded.
* @throws IllegalScriptIdentifierException if the given identifier is not properly formatted.
*/
Runner resolveRunner(String identifier, Context context);
}
|
How to use the new scripting language within the workflow diagram editor?¶
Important
Feature not implemented yet.