moar
This commit is contained in:
@@ -34,4 +34,27 @@ public class OrderController {
|
||||
stateMachineService.sendMessage(OrderEvent.CANCEL);
|
||||
return "Order cancel event sent";
|
||||
}
|
||||
|
||||
// --- Functional Quirks for Static Analysis ---
|
||||
|
||||
// A getter returning a specific ENUM constant
|
||||
public OrderEvent getCompleteEvent() {
|
||||
return OrderEvent.COMPLETE;
|
||||
}
|
||||
|
||||
// A specific function that performs the transition
|
||||
public Void triggerTransitionFunction(click.kamil.domain.IEvent event) {
|
||||
stateMachineService.sendMessage(event);
|
||||
return null;
|
||||
}
|
||||
|
||||
@PostMapping("/functional-complete")
|
||||
public String functionalCompleteOrder() {
|
||||
// Pass the getter and the transition applier as method references
|
||||
stateMachineService.executeFunctionalTransition(
|
||||
this::getCompleteEvent,
|
||||
this::triggerTransitionFunction
|
||||
);
|
||||
return "Functional complete event triggered via method references";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user