Skip to content

Commit 7cfffb3

Browse files
authored
Merge pull request #731 from PROCEED-Labs/instance-view-ui
Instance View
2 parents 1f842db + 060d76b commit 7cfffb3

7 files changed

Lines changed: 321 additions & 101 deletions

File tree

src/engine/universal/core/src/engine/engine.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ class Engine {
242242
}
243243
}
244244

245+
/**
246+
* Returns whether the given process version is currently deployed in the NeoBPMN Engine
247+
*
248+
* @param {string} versionId the version of the process to check
249+
* @returns {boolean} true if the version is deployed, false if it is known but not active
250+
*/
251+
async isProcessVersionDeployed(versionId) {
252+
return this._versionProcessMapping[versionId]?.isDeployed() ?? false;
253+
}
254+
245255
/**
246256
* Starts the execution of a BPMN process version. This can involve the creation of
247257
* multiple instances of the process, if the process contains such events.

src/engine/universal/distribution/src/routes/ProcessInstanceRoutes.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,28 @@ module.exports = (path, management) => {
460460
response: '{}',
461461
};
462462
});
463+
464+
network.get(`${path}/:definitionId/versions/:version/active`, { cors: true }, async (req) => {
465+
const { definitionId, version } = req.params;
466+
467+
try {
468+
await db.getProcessVersion(definitionId, version);
469+
} catch {
470+
return {
471+
statusCode: 404,
472+
mimeType: 'text/plain',
473+
response: 'The requested version is not found in this engine.',
474+
};
475+
}
476+
477+
const engine = management.getEngineWithDefinitionId(definitionId);
478+
479+
return {
480+
statusCode: 200,
481+
mimeType: 'application/json',
482+
response: JSON.stringify({
483+
active: engine ? await engine.isProcessVersionDeployed(version) : false,
484+
}),
485+
};
486+
});
463487
};

src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/process-deployment-view.module.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,18 @@
99
.StopIcon {
1010
color: #ff4d4f;
1111
}
12+
13+
@keyframes spin {
14+
from {
15+
transform: rotate(0deg);
16+
}
17+
to {
18+
transform: rotate(360deg);
19+
}
20+
}
21+
22+
.SpinIcon {
23+
animation: spin 2s linear infinite;
24+
display: flex;
25+
align-items: center;
26+
}

0 commit comments

Comments
 (0)