Skip to content

Commit

Permalink
minor fixes (Issue #377)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Feb 13, 2025
1 parent a456dfe commit 746cf62
Show file tree
Hide file tree
Showing 4 changed files with 3,774 additions and 2,784 deletions.
3 changes: 2 additions & 1 deletion open-bpmn.glsp-client/open-bpmn-glsp/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
helperLineModule,
initializeDiagramContainer,
moveFeature,
overrideModelElement,
selectFeature
} from '@eclipse-glsp/client';
import {
Expand Down Expand Up @@ -106,7 +107,7 @@ const bpmnDiagramModule = new ContainerModule((bind, unbind, isBound, rebind) =>

// Configure BMW View Elements
configureDefaultModelElements(context);
configureModelElement(context, DefaultTypes.GRAPH, GGraph, BPMNGridView);
overrideModelElement(context, DefaultTypes.GRAPH, GGraph, BPMNGridView);
configureModelElement(context, 'task', TaskNode, TaskNodeView);
configureModelElement(context, 'manualTask', TaskNode, TaskNodeView);
configureModelElement(context, 'userTask', TaskNode, TaskNodeView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ import { ContainerModule } from '@theia/core/shared/inversify';
import { BPMNGLSPSocketServerContribution } from './bpmn-glsp-server-contribution';

export default new ContainerModule(bind => {
if (isDirectWebSocketConnection()) {
console.log('├── DirectWebSocketConnection = true');
return;
if (isDebugMode()) {
console.log('├── Running in Debug Mode');
console.log('│ └── connecting to external server...');
} else {
console.log('├── Lauch embedded GLSP Server...');
}
console.log('├── DirectWebSocketConnection = false');
console.log('│ └── launch server...');
bindAsService(bind, GLSPServerContribution, BPMNGLSPSocketServerContribution);
});

const directWebSocketArg = '--directWebSocket';
const glspDebugArg = '--glspDebug';
/**
* Utility function to parse if the frontend should connect directly to a running GLSP WebSocket Server instance
* and skip the binding of the backend contribution.
* i.e. if the {@link directWebSocketArg `--directWebSocket`} argument has been passed.
* @returns `true` if the {@link directWebSocketArg `--directWebSocket`} argument has been set.
* and skip the binding of the backend contribution (GLSP Debug mode).
* i.e. if the {@link glspDebug `--glspDebug`} argument has been passed.
* @returns `true` if the {@link glspDebug `--glspDebug`} argument has been set.
*/
function isDirectWebSocketConnection(): boolean {
function isDebugMode(): boolean {
console.log('args='+process.argv);
const args = process.argv.filter(a => a.toLowerCase().startsWith(directWebSocketArg.toLowerCase()));
const args = process.argv.filter(a => a.toLowerCase().startsWith(glspDebugArg.toLowerCase()));
return args.length > 0;
}
2 changes: 1 addition & 1 deletion open-bpmn.glsp-client/open-bpmn-theia/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@eclipse-glsp/ts-config/tsconfig.json",
"extends": "@eclipse-glsp/ts-config",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
Expand Down
Loading

0 comments on commit 746cf62

Please sign in to comment.