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

Perform some actions before evaluating guards #1120

Open
JaspreetChhabra opened this issue Nov 1, 2023 · 0 comments
Open

Perform some actions before evaluating guards #1120

JaspreetChhabra opened this issue Nov 1, 2023 · 0 comments
Labels
status/need-triage Team needs to triage and take a first look

Comments

@JaspreetChhabra
Copy link

I am trying to find a way to perform actions before the guards are evaluated like want to add API response into the extended state object which is triggered for a specific State and event and based on that response want to evaluate the guards. But I am unable to find any listener or interceptor that serves the purpose.

I am new to spring boot state machine. Can somebody please help?

@Override public void configure( StateMachineTransitionConfigurer<RedactionStates, RedactionEvents> transitions) throws Exception { transitions .withExternal() .source(RedactionStates.R1) .target(RedactionStates.R2) .event(RedactionEvents.E1) .action(c -> { // Make the API Call // Store in the extended state }) .guard(new G1(COMPLETED)) .and() .withExternal() .source(RedactionStates.R1) .target(RedactionStates.R3) .event(RedactionEvents.E1) .guard(new G2(SKIPPED)) .and() .withExternal() .source(RedactionStates.R1) .target(RedactionStates.R4) .guard(new G3(IN_PROGRESS)); }

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-triage Team needs to triage and take a first look
Projects
None yet
Development

No branches or pull requests

1 participant