Documentation
¶
Overview ¶
Package dmn wraps the QuantumBPM DMN evaluation endpoints with a project-scoped client. Use Client.Evaluate for stored definitions and Client.EvaluateDesign for ad-hoc XML.
Index ¶
- type BatchResult
- type Client
- func (c *Client) Evaluate(ctx context.Context, definitionsID string, vars variables.Vars, ...) (Result, error)
- func (c *Client) EvaluateByID(ctx context.Context, definitionID openapi_types.UUID, vars variables.Vars, ...) (Result, error)
- func (c *Client) EvaluateDesign(ctx context.Context, xml string, vars variables.Vars, opts ...DesignOption) (Result, error)
- func (c *Client) EvaluateDesignBatch(ctx context.Context, xml string, rows []variables.Vars) (BatchResult, error)
- type DesignOption
- type EvaluateOption
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchResult ¶
type BatchResult = generated.BatchEvaluationResponse
BatchResult is one result row per input row in a batch evaluation.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client evaluates DMN definitions in a single project.
func New ¶
func New(api *generated.ClientWithResponses, projectID openapi_types.UUID) *Client
New constructs a DMN client bound to projectID. api is the authenticated generated client (typically obtained from auth.NewClient).
func (*Client) Evaluate ¶
func (c *Client) Evaluate(ctx context.Context, definitionsID string, vars variables.Vars, opts ...EvaluateOption) (Result, error)
Evaluate runs a stored DMN definition identified by its DMN XML `<definitions id="…">` value. This is the typical evaluation path: stable across deployed versions, addressable by business identifiers from the model.
func (*Client) EvaluateByID ¶
func (c *Client) EvaluateByID(ctx context.Context, definitionID openapi_types.UUID, vars variables.Vars, opts ...EvaluateOption) (Result, error)
EvaluateByID runs a stored DMN definition addressed by its platform UUID. Prefer Evaluate (by definitions ID) for normal use; this overload is for callers that already hold a database-version pointer.
func (*Client) EvaluateDesign ¶
func (c *Client) EvaluateDesign(ctx context.Context, xml string, vars variables.Vars, opts ...DesignOption) (Result, error)
EvaluateDesign runs ad-hoc DMN XML against an input context. The XML is not stored; useful for "evaluate while editing" flows.
func (*Client) EvaluateDesignBatch ¶
func (c *Client) EvaluateDesignBatch(ctx context.Context, xml string, rows []variables.Vars) (BatchResult, error)
EvaluateDesignBatch evaluates the same XML against many input rows in a single request, returning per-row results.
type DesignOption ¶
type DesignOption func(*designOpts)
DesignOption tunes an ad-hoc design evaluation.
func WithAdditionalXMLs ¶
func WithAdditionalXMLs(xmls ...string) DesignOption
WithAdditionalXMLs supplies extra DMN documents whose decisions can be imported and referenced from the primary xml.
func WithDesignDecisionServices ¶
func WithDesignDecisionServices(names ...string) DesignOption
WithDesignDecisionServices selects decision services to evaluate.
func WithDesignDecisions ¶
func WithDesignDecisions(names ...string) DesignOption
WithDesignDecisions restricts a design evaluation to the named decisions.
type EvaluateOption ¶
type EvaluateOption func(*evaluateOpts)
EvaluateOption tunes a stored DMN evaluation.
func WithBusinessID ¶ added in v1.0.0
func WithBusinessID(id string) EvaluateOption
WithBusinessID stamps the resulting DMN execution row with a caller-supplied correlation key for cross-system tracing.
func WithDecisionServices ¶
func WithDecisionServices(names ...string) EvaluateOption
WithDecisionServices selects decision services to evaluate.
func WithDecisions ¶
func WithDecisions(names ...string) EvaluateOption
WithDecisions restricts evaluation to the named decisions in the document. Without this option, every decision is evaluated.
func WithVersion ¶
func WithVersion(v int) EvaluateOption
WithVersion pins the evaluation to a specific version of the definition. Without this option, the latest version is used.
type Result ¶
type Result = map[string]generated.EvaluationResult
Result maps decision IDs to the result of evaluating that decision.