deleteCostRules
Purpose
Deletes the cost rules for a given set of cost rule IDs.
Function
Deletes the given cost rules. If a rule is not found for a given ID it is silently ignored. The default rule cannot be deleted, and attempts to delete it are ignored.
After the cost rule is deleted, the costs related with this cost rule will be recalculated for all entities in the system. This operation is not performed in the "frozen" state. This is done asynchronously by the Cost Rate Rule Update service.
Related Information
getCostRules reads a collection of cost rules.
Input
An object with an array of cost rule IDs.
Return
None
Java Interface
deleteCostRules (DeleteCostRulesDocument in)
Parameters |
Description |
---|---|
DeleteCostRulesDocument |
Wrapper for cost rule ids array. See the following example for the construction. The following field is required:
|
Java Examples
Example: delete a set of cost rules.
void deleteCostRules(long[] ids) throws Exception { FinanceServiceStub FM = new FinanceServiceStub(ctx, WSURL); DeleteCostRulesDocument deleteCostRulesDoc = DeleteCostRulesDocument.Factory.newInstance();
deleteCostRulesDoc.addNewDeleteCostRules().setCostRuleIdArray(ids); FM.deleteCostRules(deleteCostRulesDoc); }
Errors and Exceptions
When an error occurs on this operation, you will see a description of the root cause in the log or in the response message.
The server log file content is similar to the following:
Exception in thread "main" org.apache.axis2.AxisFault: <exception:exceptionDetails xmlns:exception="http://www.mercury.com/ppm/ws/exception"> <exception:detail>[root cause description] </exception:detail> </exception:exceptionDetails>
Root Cause Descriptions
Possible root cause descriptions:
Message Code | Message | Cause(s) | Possible Corrective Action |
---|---|---|---|
exception.authorization | You do not have the privilege to take this action. Consult your PPM Administrator. | User is not authorized to delete the cost rule | Check the user licenses and privileges (access grants). |
Note: If the ID you provide to delete a cost rule is not found, the operation is silently ignored, and no exception is thrown.