-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add draft mode and join feature #133
Conversation
The silent flag in the update message service was included in the new BDK release, this commit is to support the same in WDK.
This big commit is mainly focus on refactoring the CamundaBpmnBuilder.java code, in order to * Improve the code readibility and maintainability * Make the bpmn schema generation be more consistent and accurate * Fix some known bugs The major changes include using a direct graph data structure and DFS algorithm in this translation process.
* Add draft mode on workflow definition, a draft workflow won't be deployed * Add a validation step in the workflow engine, so user can validate the workflow without having to deploy it * Add join feature, a new "all-of" event list, so all events must happen before moving forward the workflow
Object instance = workflowEngine.parseAndValidate(workflow); | ||
if (workflow.isToPublish()) { | ||
workflowEngine.deploy(workflow, instance); | ||
} else if (deployedWorkflows.get(workflowFile) != null && deployedWorkflows.get(workflowFile).getRight()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean, if we have a workflow already deployed, and we update the workflow file and we put it as draft, the original one will get undeployed? Is it the behaviour we really want?
For me, the draft mode should not change the already deployed workflows. The management api #127 should be used for that.
} else if (deployedWorkflows.get(workflowFile) != null && deployedWorkflows.get(workflowFile).getRight()) { | ||
workflowEngine.undeploy(deployedWorkflows.get(workflowFile).getLeft()); | ||
} | ||
deployedWorkflows.put(workflowFile, Pair.of(workflow.getId(), workflow.isToPublish())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here the worklowFile entry will get overridden. Maybe in the draft mode, we do nothing so we only keep the new file version in disk.
workflow-bot-app/src/test/java/com/symphony/bdk/workflow/EngineIntegrationTest.java
Outdated
Show resolved
Hide resolved
final Workflow workflow = SwadlParser.fromYaml(getClass().getResourceAsStream( | ||
"/validation/validate-only.swadl.yaml")); | ||
|
||
when(messageService.send(anyString(), any(Message.class))).thenReturn(message("ignored message")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Beside the "oneOf" feature, this commit adds the "allOf" feature, so that all events under the "allOf" list must have happened before moving forward to the next step in the workflow. This feature is implemented by using ParallelGateway in camunda API.
workflow-bot-app/src/main/java/com/symphony/bdk/workflow/WorkflowValidator.java
Outdated
Show resolved
Hide resolved
workflow-bot-app/src/main/java/com/symphony/bdk/workflow/engine/WorkflowNode.java
Outdated
Show resolved
Hide resolved
a050ef5
to
4de0581
Compare
4de0581
to
b792421
Compare
Description
Please put here the intent of your pull request.
Dependencies
List the other pull requests that should be merged before/along this one.
Checklist