Skip to content
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

Merged
merged 5 commits into from
Aug 21, 2022

Conversation

yinan-symphony
Copy link
Contributor

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

  • Referenced a ticket in the PR title or description
  • Filled properly the description and dependencies, if any
  • Unit/Integration tests updated or added
  • Javadoc added or updated
  • Updated the documentation in docs folder

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()) {
Copy link
Contributor

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()));
Copy link
Contributor

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.

final Workflow workflow = SwadlParser.fromYaml(getClass().getResourceAsStream(
"/validation/validate-only.swadl.yaml"));

when(messageService.send(anyString(), any(Message.class))).thenReturn(message("ignored message"));
Copy link
Contributor

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.
@yinan-symphony yinan-symphony force-pushed the task/draft-mode branch 2 times, most recently from a050ef5 to 4de0581 Compare August 19, 2022 08:25
@yinan-symphony yinan-symphony changed the title Task/draft mode Add draft mode and join feature Aug 21, 2022
@yinan-symphony yinan-symphony merged commit fd5ed22 into finos:master Aug 21, 2022
@symphony-soufiane symphony-soufiane linked an issue Aug 30, 2022 that may be closed by this pull request
@symphony-soufiane symphony-soufiane linked an issue Aug 30, 2022 that may be closed by this pull request
@yinan-symphony yinan-symphony deleted the task/draft-mode branch June 9, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Draft Mode Support Workflow Joins
2 participants