Skip to content

Conversation

mcruzdev
Copy link
Contributor

Description

This pull request aims to align the Java SDK Workflow API woth other languages (Python, C#, etc.)

What this pull request does:

  • Deprecate waitForInstanceStart, getInstanceState and waitForInstanceCompletion.
  • Change the documentation to use the new methods (waitForWorkflowStart, getWorkflowState and waitForWorkflowCompletion)
  • Change test to use the new methods.

Issue reference

Closes #1554

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@mcruzdev mcruzdev requested review from a team as code owners September 20, 2025 20:02
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@siri-varma
Copy link
Contributor

@mcruzdev The patch coverage is failing. Looks like some more unit tests are needed.

@siri-varma
Copy link
Contributor

LGTM. Can be merged once the patch succeedes

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.41%. Comparing base (d759c53) to head (c0fa512).
⚠️ Report is 226 commits behind head on master.

Files with missing lines Patch % Lines
...a/io/dapr/workflows/client/DaprWorkflowClient.java 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1560      +/-   ##
============================================
+ Coverage     76.91%   78.41%   +1.50%     
- Complexity     1592     1913     +321     
============================================
  Files           145      215      +70     
  Lines          4843     5833     +990     
  Branches        562      652      +90     
============================================
+ Hits           3725     4574     +849     
- Misses          821      922     +101     
- Partials        297      337      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

artur-ciocanu

This comment was marked as duplicate.

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcruzdev thanks a lot for looking into this.

I would like to request changes and suggest some improvements:

  • There is another method in the DaprWorkflowClient which uses instance purgeInstance I think it should be renamed to purgeWorkflow to stay consistent with other API changes.
  • We should add a new interface named WorkflowState that should be similar to WorkflowInstanceStatus and we should ensure that instead of getInstanceId we use getWorkflowId
  • Once you have the new interface you should adjust the implementation to ensure that the new methods use the new interface.
  • You will also have to add an implementation similar to DefaultWorkflowInstanceStatus but for WorkflowState something like DefaultWorkflowState.
  • One more thing I think we should adjust Java Docs to use workflowId instead of instanceId so we have a more clean API description.

I know it is a little bit more work, but I think it is totally worth it if we want to align with other SDKs.

Thank you 🙇

CC: @salaboy @cicoyle

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.

Align getInstanceState and other instance-based APIs with workflow naming
3 participants