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

Incomplete Constructor Switch(WorkflowTask) Implementation Breaking WorkflowDef-to-ConductorWorkflow Conversion #97

Open
charleslip opened this issue Mar 2, 2024 · 0 comments

Comments

@charleslip
Copy link

Describe the bug
Current java-sdk implementation of Switch class constructor Switch(WorkflowTask) is incomplete, hence breaking WorkflowDef-to-ConductorWorkflow conversion.

The shortcoming can be corrected by adding the following statements to constructor Switch(WorkflowTask):
this.useJavascript = workflowTask.getEvaluatorType().equals(JAVASCRIPT_NAME);
this.caseExpression = (String)this.getInput().get("switchCaseValue");

Switch-mod

Details
Conductor version: 3.17.0
Persistence implementation: Cassandra, Postgres
Queue implementation: Postgres
Lock: Redis
Workflow definition:
Task definition: Switch
Event handler definition:

To Reproduce
The WorkflowDef-to-ConductorWorkflow conversion fault is reproduced by modifying example app java-sdk-examples to function as test program.
Statements were added to Main.java starting at Line 54 for ConductorWorkflow -> WorkflowDef -> ConductorWorkflow conversion.

//ConductorWorkflow -> WorkflowDef conversion
WorkflowDef workflowDef = simpleWorkflow.toWorkflowDef();

//WorkflowDef -> ConductorWorkflow conversion
simpleWorkflow = ConductorWorkflow.fromWorkflowDef(workflowDef);

//executeDynamic
workflowExecution = utils.getWorkflowExecutor().executeWorkflow(simpleWorkflow, input);
workflowRun = workflowExecution.get(10, TimeUnit.SECONDS);

Main-test

Expected behavior
If class-constructor Switch(WorkflowTask) is functioning correctly, the resultant workflow which has undergone ConductorWorkflow->WorkflowDef->ConductorWorkflow conversion should behave exactly as the original workflow.

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

No branches or pull requests

1 participant