temporalio / temporalio/sdk-java

Update all state machines to avoid self transitions and hidden logic

Open
#193 0 comments 0 reactions 1 assignee View on GitHub

@Sushisource is already working on this.

Since Nov 25, 2020.

Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

Some workflow state machines have self transitions and additional conditional logic which is not part of the modeled state machine. For example, ActivityStateMachine has these self transitions:

SCHEDULE_COMMAND_CREATED --> SCHEDULE_COMMAND_CREATED: SCHEDULE_ACTIVITY_TASK
STARTED_ACTIVITY_CANCEL_COMMAND_CREATED --> STARTED_ACTIVITY_CANCEL_COMMAND_CREATED: REQUEST_CANCEL_ACTIVITY_TASK
SCHEDULED_ACTIVITY_CANCEL_COMMAND_CREATED --> SCHEDULED_ACTIVITY_CANCEL_COMMAND_CREATED: REQUEST_CANCEL_ACTIVITY_TASK

These should be eliminated by introducing additional states as each of the events that cause state transition can be applied only once.

Activity cancellationType is modeled using if/else conditions in ActivityStateMachine. This should be converted to additional states in the state machine itself.

The goal of these changes is to make sure that all of the complex logic related to activity execution is explicitly modeled. This would simplify the understanding of the logic and help with the creation of additional SDKs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.