Share all details related to your problem, including any error messages you may have received.
Hi all,
I am new to rule development and I have a question on the saveObject method. Can the saveObject method be used on approvalItems, approvalSets, and workItems?
I tried using the method on approvalItem it threw a method invocation error
BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: import sailpoint.object.*; import sailpoint.object.Workflow; import sailpoint. . . . '' : Error in method invocation: Method saveObject(sailpoint.object.ApprovalItem) not found in class'sailpoint.server.InternalContext' : at Line: 117 : in file: inline evaluation of: import sailpoint.object.*; import sailpoint.object.Workflow; import sailpoint. . . . ‘’ : context .saveObject (aItem)
I have attached the rule that threw the error. as a txt file. Could anyone please help ?
It can save any object which extends SailPointObject.
ApprovalItem and ApprovalSet are not extending SailPointObject, therefore it cannot be saved using saveObject.
Workitem does extend SailPointObject and can be saved.
The javadoc can be found at each installation (and should be removed in production environments) via https:///identityiq/doc/javadoc/index.html
When saving an object, be sure the transaction is committed as well, otherwise it will not be saved in the database.
@sreeram
As @iamnithesh and @Remold mentioned you cannot save Approval Item object but you can set the state of the item within the approval Assignment rule, what is your exact use case here so that we can help accordingly.
To elaborate, the rule is an approvalAssignmentRule. I was using this rule to develop a custom approval mechanism. The custom approval requires 2 level of approvals(1. Manager, 2. Owner (custom owner fetched from a customObj)).
Approval Mode: Serial
approvalSplitPoint: Owner
I configured the LCM provisioning and approve and provision workflow to split the approval into parallel mode by defining the approvalSplitpoint & providing the approvalAssignmentRule to handle the logic.
However, after the manager’s approval, it skips the 2nd level of approval and directly provisions. Looking at the trace, It was observed that the workItem state is set to “Finished” after the manager’s approval.