Package com.axelor.workflow.expression
Class WorkflowSnapshots
java.lang.Object
com.axelor.workflow.expression.WorkflowSnapshots
Builds the flat field snapshot a
when evaluates against: the entity's persistent scalars
plus its custom fields flattened to top-level keys, real fields winning on a collision. Serves
entities and custom models alike.-
Method Summary
Modifier and TypeMethodDescriptionliveContext(Model entity, Class<?> klass, String when) The gate context from a live entity, for the scheduler's re-check: scalars and FK ids, with the traversed references expanded.Parse a JSON object string into a flat map; empty for null/blank/unparseable input.Expands each candidate that is a single-value reference from its FK id to the target's scalar map, loaded in the caller's after-commit transaction; a deleted target becomes null.traversalCandidates(String when) The fields awhenexpression may traverse: first segments followed by another dot, string literals stripped.
-
Method Details
-
scalars
-
traversalCandidates
The fields awhenexpression may traverse: first segments followed by another dot, string literals stripped.resolveReferences(java.util.Map<java.lang.String, java.lang.Object>, java.util.Set<java.lang.String>, java.lang.Class<?>)decides which are references. -
resolveReferences
public static Map<String,Object> resolveReferences(Map<String, Object> snapshot, Set<String> candidates, Class<?> modelClass) Expands each candidate that is a single-value reference from its FK id to the target's scalar map, loaded in the caller's after-commit transaction; a deleted target becomes null. -
liveContext
The gate context from a live entity, for the scheduler's re-check: scalars and FK ids, with the traversed references expanded. -
parseJson
Parse a JSON object string into a flat map; empty for null/blank/unparseable input.
-