![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@eclipse-emfcloud/coffee-triggers-example
Advanced tools
Example server-side triggers plug-in for the Model Server.
This package provides an example of a trigger provider plug-in for the Model Server.
It provides a trigger that ensures the duration
of a workflow Task
in a Coffee model is always a multiple of ten.
See the parent readme for details of how to set up and build the project.
For detailed instructions how to run the example server configuration that includes this plug-in example, see the Example Server readme.
There are a variety of tools available for ad hoc REST interactions with services such as the Model Server. A recommended option is the Postman application.
Start by fetching the current state of the model.
Send a GET
request to
http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee
The result should look something like this:
{
"type": "success",
"data": {
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//Machine",
"$id": "/",
"children": [
// ... structural components here ...
],
"name": "Super Brewer 3000",
"workflows": [
{
"$id": "//@workflows.0",
"name": "Simple Workflow",
"nodes": [
{
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//AutomaticTask",
"$id": "//@workflows.0/@nodes.0",
"name": "PreHeat",
"component": {
"$type": "http://www.eclipsesource.com/modelserver/example/coffeemodel#//BrewingUnit",
"$ref": "//@children.0"
}
}
]
}
]
}
}
Make note of the EMF-style URI fragment $id
of the PreHeat task, which must be inferred from the model structure.
The URI fragment is //@workflows.0/@nodes.0
: the first node of the first workflow in the root Machine
object.
This will be used to build requests to edit the duration
.
Next, send a request to change the duration
property of this task.
For example, this could be the example custom increment-duration
command or a simple SetCommand
or replace
JSON Patch operation.
For example, send a PATCH
request to
http://localhost:8082/api/v2/models?modeluri=SuperBrewer3000.coffee
with the following body:
{
"data": {
"type": "modelserver.patch",
"data": [
{
"op": "replace",
"path": "SuperBrewer3000.coffee#//@workflows.0/@nodes.0/duration",
"value": 37
}
]
}
}
Observe in the response that there is a final change to the duration
that rounds it up to the next multiple of ten.
A typical response looks something like this:
{
"type": "success",
"data": {
"success": true,
"patch": [
{
"op": "replace",
"path": "/workflows/0/nodes/0/duration",
"value": 37
},
{
"op": "replace",
"path": "/workflows/0/nodes/0/duration",
"value": 40
}
]
}
}
Fetch the model again with a GET request to see that the final value of the duration
of the PreHeat task is a nice round multiple of ten.
A critical component of this trigger provider framework is that the changes made by triggers are included in undo/redo of whatever changes triggered them.
To send an undo command to the Model Server, simply send a GET
request to
http://localhost:8082/api/v2/undo?modeluri=SuperBrewer3000.coffee
Follow that up with a GET
on the /api/v2/models
endpoint to see how the duration
of the PreHeat Task
is reverted.
The intermediate values that are not multiples of ten are not evident because all changes are undone at each step.
FAQs
Example server-side triggers plug-in for the Model Server.
We found that @eclipse-emfcloud/coffee-triggers-example demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.