Rule Method Requirements
Workflow Assignment Rule methods must follow specific requirements to receive context information and create assignments correctly.
Input
Rules run against:
- A Workflow Process ( Target = “Workflow”) or
- An Activity ( Target = “Activity”)
Context is provided via:
// Context attributes passed by the rule execution enginestring contextTypeId = this.getAttribute(“context_type_id”); // ItemType ID of CPD-controlled itemstring contextItemId = this.getAttribute(“context_item_id”); // Item ID of CPD-controlled item
This allows rules to inspect the source Change Item (e.g., CO, CR, CT) and its data.
Expected Behavior
Rule methods must:
- Load context item (if needed)
- Check existing assignments
- Determine correct assignees based on business logic
- Add, update, or remove Activity Assignments
- Return success or error
Return Values
Rule methods must return either a success result or an error:
Success:
return this; // Return the original item// Orreturn inn.newResult(“Created 3 assignments successfully”);
Error:
return inn.newError(“No manager found for user”); // SOAP Fault - recommended// Orthrow new Exception(“Database connection failed”); // Exception - critical errors only
See Section 7.4.2 for detailed error handling strategy and best practices.