Rule Operation Classification System Design

Rule Operation Classification System Design

I. Core Understanding

Rules are used in two key stages:

  1. Assembling Prompts: Instructing the LLM on what to generate, how to generate it, and what constraints exist.
  2. Assembling AML: After the front-end receives the JSON from the LLM, it corrects, completes, and validates it according to rules to generate valid AML.

II. Operation Types and Rule Mapping

add (Create)

Rule CategoryPrompt UsageAML Assembly Usage
required (Mandatory)Instruct LLM it must be generatedvalidateProperties check
validation (Validation)Instruct LLM on format requirementssanitizeProperties correction
pattern (Regex)Instruct LLM on matching rulesvalidateProperties check
auto_generate (Numbering)Instruct LLM to skip this fieldSequence API auto-generation
field_default (Default Value)Instruct LLM it can be omittedsanitizeProperties population
auto_create (Auto-create Relationship)Instruct LLM not neededPre-create nested Item
permission (Permission)Instruct LLM who can createFront-end permission check
lifecycle (Lifecycle)Instruct LLM on initial stateSet state in AML
workflow (Workflow)Instruct LLM to trigger a processAuto-start after creation

edit (Repair/Optimize)

Rule CategoryPrompt UsageAML Assembly Usage
validationInstruct LLM that modified values must be validsanitizeProperties correction
patternSame as abovevalidateProperties check
permissionTells LLM who can modifyFrontend permission check
lifecycle_transitionTells LLM what transitions are allowed from the current stateState transition validation
calculationTells LLM the calculation ruleAutomatically calculates field values
requiredTells LLM which fields cannot be clearedvalidateProperties check

get (retrieve/query)

Rule CategoryPrompt PurposeAML Assembly Purpose
keyed (key field)Tells LLM what to use for queryingBuilds AML query conditions
permissionTells LLM who can viewQuery permission filtering
relationshipTells LLM which relationships to fetchBuilds AML query depth
lifecycleTells LLM to filter by stateAML where condition

III. Relationship Handling Rules

During creation (add)

  • Relationship with create_related=1: Automatically creates related object when the main object is created.
  • Relationship with related_notnull=1: The related object must exist.
  • Relationship with is_dependent=1: The related object's lifecycle depends on the main object.
  • Behavior float: The related object can exist independently.
  • Behavior part: The related object is part of the main object.

During query (get)

  • is_list_type=1: One-to-many relationship, use getRelatedItems when querying.
  • auto_search=1: Automatically searches for related objects.

During editing (edit)

  • Cascading update: Which fields of the related object need to be synchronized when the main object's attributes are modified.
  • State propagation: Whether the related object's state changes when the main object's state changes.

IV. Organization of Rules in Prompts

Layered by operation type:

基础层(所有操作共享):对象定义、属性列表、数据类型
操作层(按add/edit/get区分):
  add:创建规则、编号规则、必填规则、关系创建规则、初始状态
  edit:修改规则、状态转换规则、计算规则、级联规则
  get:查询规则、键字段、关系带出规则、权限过滤规则
业务层(按业务系统区分):
  特定业务约束、特殊逻辑
← 返回案例列表

Try 左帮右臂 Industrial Agent — your digital workforce

Available as a WeChat mini program, web app (ylxt.chat) and desktop client. Start from whichever fits your workflow.

🌐 Web App 💻 Desktop Download 📞 Call 189-8606-6876
WeChat mini program QR
Scan for the WeChat mini program
Share:
🤖 Try Now →
🤖
🎁