Skip to content

Commit

Permalink
logging and docu
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Feb 10, 2024
1 parent 4f552ba commit 99349d0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 13 deletions.
46 changes: 46 additions & 0 deletions open-bpmn.glsp-client/workspace/imixs.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bpmn2:definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:open-bpmn="http://open-bpmn.org/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="org.openbpmn" exporterVersion="1.0.0" targetNamespace="http://open-bpmn.org" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL">
<bpmn2:collaboration id="collaboration_1" name="Default Collaboration">
<bpmn2:participant id="participant_m09IMQ" name="Default Process" processRef="process_1"/>
<bpmn2:participant id="participant_7yxBtQ" name="Pool-1" processRef="process_eQk64Q">
<bpmn2:documentation id="documentation_oR00UA"/>
</bpmn2:participant>
</bpmn2:collaboration>
<bpmn2:process definitionalCollaborationRef="collaboration_1" id="process_1" name="Default Process" processType="Public">
<bpmn2:documentation id="documentation_9JebLA"/>
</bpmn2:process>
<bpmn2:process definitionalCollaborationRef="collaboration_1" id="process_eQk64Q" name="Pool-1" processType="Private">
<bpmn2:laneSet id="laneset_Clnr6w" name="Lane Set">
<bpmn2:lane id="lane_sY73fw" name="Lane 1">
<bpmn2:documentation id="documentation_dItTTw"/>
<bpmn2:flowNodeRef>event_OHIyTA</bpmn2:flowNodeRef>
<bpmn2:flowNodeRef>task_aoLpMw</bpmn2:flowNodeRef>
</bpmn2:lane>
</bpmn2:laneSet>
<bpmn2:startEvent id="event_OHIyTA" name="Event-1">
<bpmn2:documentation id="documentation_ILfNxQ"/>
</bpmn2:startEvent>
<bpmn2:task id="task_aoLpMw" name="Task-1">
<bpmn2:documentation id="documentation_L9Nwsw"/>
</bpmn2:task>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1" name="OpenBPMN Diagram">
<bpmndi:BPMNPlane bpmnElement="collaboration_1" id="BPMNPlane_1">
<bpmndi:BPMNShape bpmnElement="participant_7yxBtQ" id="BPMNShape_NXNwZw">
<dc:Bounds height="520.0" width="1110.0" x="100.0" y="80.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="lane_sY73fw" id="BPMNShape_Lane_8TYz4Q">
<dc:Bounds height="520.0" width="1080.0" x="130.0" y="80.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="event_OHIyTA" id="BPMNShape_BBPE2g">
<dc:Bounds height="36.0" width="36.0" x="197.0" y="207.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_KdfSAQ">
<dc:Bounds height="20.0" width="100.0" x="165.0" y="246.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="task_aoLpMw" id="BPMNShape_0Kx0rg">
<dc:Bounds height="50.0" width="110.0" x="330.0" y="200.0"/>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
********************************************************************************/
package org.openbpmn.glsp.launch;

import java.util.logging.Logger;

import org.apache.commons.cli.ParseException;
import org.eclipse.glsp.server.di.ServerModule;
import org.eclipse.glsp.server.launch.DefaultCLIParser;
Expand All @@ -24,12 +26,17 @@
import org.openbpmn.glsp.BPMNDiagramModule;

public final class BPMNServerLauncher {
private static Logger logger = Logger.getLogger(BPMNServerLauncher.class.getName());

private BPMNServerLauncher() {
}

public static void main(final String[] args) {
String processName = "OpenBPMNServer";
try {
logger.info("***************************");
logger.info("* Launch " + processName);
logger.info("***************************");
DefaultCLIParser parser = new DefaultCLIParser(args, processName);
LaunchUtil.configure(parser);

Expand Down
35 changes: 22 additions & 13 deletions src/site/markdown/glsp-server/BPMN_EXTENSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,42 +155,51 @@ Returns the priority of this action handler. The priority is used to derive the

## Register a BPMNExtension

To register a custom BPMNExtension you need to extend class `BPMNDiagramModule` and overwrite the method `configureBPMNExtensions`. In this method the new custom Extension Points can be registered:
To register a custom BPMNExtension you need to extend class `BPMNDiagramModule` and overwrite the methods `configureBPMNExtensions` and `configureBPMNModelExtensions`. In this methods your new custom Extension Points can be registered:

```java
public class MyBPMNDiagramModule extends BPMNDiagramModule {

public void configureBPMNExtensions(final Multibinder<BPMNElementExtension> binding) {
@Override
public void configureBPMNExtensions(final Multibinder<BPMNElementExtension> binding) {
// bind BPMN default extensions
super.configureBPMNExtensions(binding);

// Bind custom BPMNExtensions
// Bind your custom BPMNExtensions
binding.addBinding().to(MyBPMNTaskExtension.class);
}
@Override
public void configureBPMNModelExtensions(final Multibinder<BPMNModelExtension> binding) {
super.configureBPMNModelExtensions(binding);
// bind your optional model extensions....
}
}
```

Finally you implement a custom GLSP ServerLauncher to configure a new ServerModule:

```java
public final class ImixsBPMNServerLauncher {
public final class MyBPMNServerLauncher {
private MyBPMNServerLauncher() {
}
public static void main(final String[] args) {
String processName = "MyCustomOpenBPMNServer";
try {
DefaultCLIParser cliParser = new DefaultCLIParser(args, "bpmn server");
LaunchUtil.configure(cliParser);
int port = cliParser.parsePort();
ServerModule serverModule = new ServerModule().configureDiagramModule(new MyBPMNDiagramModule());
GLSPServerLauncher launcher = new SocketGLSPServerLauncher(serverModule);
DefaultCLIParser parser = new DefaultCLIParser(args, processName);
LaunchUtil.configure(parser);
int port = parser.parsePort();
ServerModule bpmnServerModule = new ServerModule()
.configureDiagramModule(new MyBPMNDiagramModule());

GLSPServerLauncher launcher = new SocketGLSPServerLauncher(bpmnServerModule);
launcher.start("localhost", port);
} catch (ParseException | IOException e) {
e.printStackTrace();
} catch (ParseException ex) {
ex.printStackTrace();
LaunchUtil.printHelp(processName, DefaultCLIParser.getDefaultOptions());
}
}
}
```

After the new ServerModule is started Open-BPMN will add the Extension to the Tool-Palette to add the Extension to a BPMN Element. After an Element was extended, the Open-BPMN Property Section will automatically show a new Section to edit the extension attributes.
After the new ServerModule is started Open-BPMN will add the Extension to the Tool-Palette to add the Extension to a BPMN Element. After an Element was extended, the Open-BPMN Property Section will automatically show the new sections to edit your extension attributes.

<img src="../images/open-bpmn-extension-01.png" />

0 comments on commit 99349d0

Please sign in to comment.