SCSAI Project: Creating a Real, Usable Recipe (Tested and Verified)
Date: 2026-07-08
Instance: https://ylxt.chat/scplm, Credentials: root/gyc123456, DATABASE SCPLM
Conclusion: WBS_ID must be created as a WBS Element first, then referenced back—it's not a missing underlying issue; previous judgment was incorrect.
Key Constraints (none can be omitted, otherwise an error occurs)
- project_number must be unique + non-null (numeric type).
- The unique constraint C91 specifically targets this column (not wbs_id).
- Error example: → Violation of UNIQUE KEY constraint "C91".
- Format must be pure numbers (e.g., 472869); string formats like PRJ-xxxx will be rejected by PropertyValueFormatException.
- The project_number for existing real Projects does have a value (e.g., 1313, 1365); it appears as NULL in queries because the Sciot client hides it.
- wbs_id must reference a 'real WBS Element already created in SCSAI'.
- Correct approach:
- Cannot use nested creation (SCSAI does not recognize it; WBS will not be created).
- Cannot pass a bare GUID string (SCSAI ignores it, wbs_id becomes NULL).
- SCSAI's server method server_update_schedule validates this: FAILURE: WBS_ID is null originates from this.
- scheduling_type must be filled with either Forward or Backward.
- Method UPDATE_SCHEDULE requires it, otherwise: scheduling_type=(null) is unknown in SQL: exec [UPDATE_SCHEDULE]...
Correct sequence (must be step-by-step)
- First, action="add" to create a WBS Element (independent Item), obtain the real id (r.items[0].id, a string).
- Then create the Project, passing simultaneously:
- unique numeric project_number
- scheduling_type=Forward
- Then create Part / Activity2 / Milestone and other remaining objects.
Common pitfalls
- owned_by_id references an Identity, must pass a real id, cannot pass a string name (e.g., 'Stamping' → is not a valid id). Leave empty/do not pass if not needed.
- Client response structure: upon success, r.items[0].id is a string (but for safety, use id.then to check with an await once).
Verified script
D:\openclaw\bossagents\import_car_plan_final.mjs (tested exit 0, 10 objects persisted:
1 WBS Element + 1 Project + 1 Part + 5 Activity2 tasks + 2 Activity2 milestones).
Regarding the repository rule-engine's create_pre-004
The intent of builtin-project-create-pre-004 is to automatically create a WBS Element and backfill the wbs_id, but probe verification shows:
After execute('create_pre') runs, context.item_properties remains empty (modifications within the vm sandbox are not written back to the outer context).
Therefore, currently do not rely on rule-engine.createItem to create Project; use the above step-by-step raw AML approach for maximum stability.
One-click verification (minimal Project)
<AML><Item type="WBS Element" action="add"><name>TEST WBS</name></Item></AML>
<!-- 取 id=X -->
<AML><Item type="Project" action="add">
<name>TEST</name>
<project_number>472869</project_number>
<scheduling_type>Forward</scheduling_type>
<wbs_id><Item type="WBS Element" action="get" id="X"/></wbs_id>
</Item></AML>
BossAgents