feat: evaluate built-in routing predicates and parameterized host conditions

Store transition when as JSON instead of a lookup key so designers can compose closed-set logic while hosts still supply complex refs with args. Match conditional edges before the unconditional default.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
0264408
2026-09-18 11:09:50 +08:00
co-authored by Cursor
parent e177e9592a
commit 1f6e33c14b
27 changed files with 781 additions and 83 deletions
@@ -153,7 +153,7 @@ class OrdoJdbcAutoConfigurationTest {
withDataSourceRunner.withUserConfiguration(CustomRoutingConditionConfig.class)
.run(context -> {
assertThat(context).hasSingleBean(OrdoEngine.class);
assertThat(context.getBean(RoutingCondition.class).matches("any", null)).isTrue();
assertThat(context.getBean(RoutingCondition.class).matches("any", java.util.Map.of(), null)).isTrue();
});
}
@@ -201,7 +201,7 @@ class OrdoJdbcAutoConfigurationTest {
static class CustomRoutingConditionConfig {
@Bean
RoutingCondition ordoRoutingCondition() {
return (key, context) -> true;
return (key, args, context) -> true;
}
}
@@ -6,7 +6,7 @@
{ "id": "hr", "name": "HR approval", "candidates": ["henry"], "policy": "ANY" }
],
"transitions": [
{ "from": "manager", "to": "hr", "when": "days-gt-3", "priority": 0 },
{ "from": "manager", "to": "hr", "when": { "gt": ["days", 3] }, "priority": 0 },
{ "from": "manager", "to": null, "priority": 1 },
{ "from": "hr", "to": null }
]