MDWorkbench Server is an extensible platform in which you can create your own services, to execute data transformation or code generation on server side.
A service is either implemented using an MDWorkbench Ruleset or an MDWorkbench Operation. Services implemented by an operation can execute concurrently whereas only one service can execute at a time when implemented by a ruleset.
Here are the steps to add a service:
com.sodius.mdw.server
com.sodius.mdw.server.service
extension point and click Finish.com.sodius.mdw.server.service
extension and right-click New > Service.OperationFactory
interface.
OperationContext
sent to the OperationFactory
.Please refer to MDWorkbench documentation to create an MDWorkbench Project:
MDWorkbench Documentation > Tasks > Developing Rules
Servlet Context Parameters are accessible within the rules by querying the
EvaluationContext.getProperty(String)
method, e.g.:
String workspaceLocation = (String) context.getProperty("mdw.server.workspace");
Please refer to MDWorkbench documentation to create an MDWorkbench Project:
MDWorkbench Documentation > Tasks > Developing Operations
The OperationFactory
subclass to create (and to reference in the service extension)
is in charge to create the main Operation
to execute.
It receives an OperationContext
that contains the values associated
with the parameters declared by the service, e.g.:
String myParameterValue = (String) context.getProperty("myServiceParameterName");
Servlet Context Parameters are accessible in the OperationContext
instance as well, e.g.:
String workspaceLocation = (String) context.getProperty("mdw.server.workspace");
If files are to generate,
the OPTION_EVALUATION_DIRECTORY option,
present in the context, indicates the directory in which such files should be generated for them to appear as a result of the service execution, e.g.:
File directory = new File((String) context.getProperty(LaunchManager.OPTION_EVALUATION_DIRECTORY)); File generatedFile = new File(directory, "result.txt"); // and now write something in that file...
You can then test the new Service using Jetty and verify you can execute it correctly using the integration page:
http://localhost:27888/mdworkbench/web/dev/services.html
Creating Plug-Ins
Testing with Jetty
Declaring Service Parameters
Reporting Progress
Customizing the Launch Status
Adding a Custom Launch Page