expression-sets

Inspect and author Salesforce Revenue Cloud BRE Expression Sets via Connect and Metadata APIs.

33|12|Updated Sep 24, 2024
One-click install
npx skills add https://github.com/bgaldino/rlm-base-dev --skill expression-sets-bgaldino
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expression-sets
Source: https://github.com/bgaldino/rlm-base-dev/tree/main/.cursor/skills/expression-sets
Command: npx skills add https://github.com/bgaldino/rlm-base-dev --skill expression-sets-bgaldino

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Editing Salesforce Revenue Cloud Expression Sets (pricing, rating, qualification, and discovery procedures) programmatically is error-prone: Connect API payloads are HTML-escaped, mutations require a deactivate-modify-reactivate lifecycle, step graphs are flat with per-parent sequence numbers, and labels get clobbered on every Connect PATCH. This Skill encodes all of those live-verified rules so an agent can safely export, modify, overlay, and reactivate procedures without corrupting them. ## Core Features & Use Cases - Programmatic CRUD and overlays: Export, create, replace, delete, and apply declarative addSteps/removeSteps/updateSteps overlays to Expression Sets through the Connect API or Metadata API, with pre-flight validation and guarded activation lifecycle. - Inspection and tracing toolkit: List procedures by type, describe steps in execution order, trace variable producers/consumers, diff procedures org-vs-org, and render Mermaid dependency or flow diagrams. - Dependency capture and safe removal: Classify every referenced name into version variables, custom external dependencies, or standard context, and detect orphaned consumers before removing a step. - Use Case: You need to add a discount step to a pricing procedure. Export the live procedure, slice a validated overlay from a known-good step, preview the apply against a disposable clone, then confirm the mutation and verify labels were preserved. ## Quick Start Ask the agent to list the org's Expression Sets with scripts/expression_sets/list_expression_sets.py, then export RLM_DefaultPricingProcedure and trace who produces and consumes the NetUnitPrice variable.

Frequently Asked Questions about expression-sets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I modify a Salesforce Expression Set programmatically?

Use the Connect API tasks or the scripts/expression_sets toolkit to export the definition as JSON, edit or slice an overlay, then apply it. Every mutation runs deactivate, PATCH or POST, reactivate in a guarded finally block, with pre-flight validation before any call.

Connect API vs Metadata API for authoring Expression Sets?

Use the Metadata API (expressionSetDefinition XML plus deploy) for source-controlled, git-tracked changes, and the Connect API for runtime programmatic CRUD or org-to-org capture. Step, parameter, and variable shapes are identical across both paths.

Why does my Expression Set PATCH fail with Syntax error Found '&'?

Connect GET output HTML-escapes string values like " and ', and the engine rejects those entities on write. Always HTML-unescape the payload before sending; the mutation tasks do this automatically via normalize_html_entities, which defaults on.

Can I use this skill for Constraint expression sets?

No. Constraint sets are authored in CML (Constraint Modeling Language) and shipped as a plain-text blob, not a step graph, so the overlay tooling and step model do not apply. Use the constraint-models skill for those.

Why did my step labels disappear after a Connect import?

Connect has no label field, so every full-graph PATCH resets each label to its step name. The import and overlay tasks capture and restore labels via the Tooling API by default; otherwise run relabel_expression_set.py as the last step after all Connect work.

Is it safe to remove a step if the procedure still reactivates?

No. Engine validation is structural, not functional, so a removal can reactivate while leaving consumers or filters orphaned and silently mispricing. Trace the step's output consumers first and test removals on a disposable clone.