How to get all criteria that matched on a status via SDK
Hi
Can anyone please let me know how to fetch matching criteria from a current status on workflow
For Example :
Let say available criteria are C1,C2,C3,C4 on a Status ‘CCB’
if only C1 and C2 matches then it should return C1 & C2 only as it enters CCB
You can check the Audit method of a IRoutable object
Map audit | ( | ) | throws APIException |
Audits the release state of a routable object.
Returns a Map
. Each map entry may consist of ICell
objects or/and null object as a key and List
of APIException objects as a value. ICell
specifies incomplete data in required fields for the release state of the routable object. List
of APIException
objects describes problem with the cell. Value for null key describes problem unrelated to cells. Before the routable object can be released, all required fields must be completed.
- Exceptions:
-
APIException if the method fails to audit the routable object
- Since:
- 8.8
for example: Map<Integer,Object> fields = change.audit();
Thanks Antonio
But what we want is
When a change moves to a given status say ‘CCB’
and on CCB it matches with one or more of several criteria available and populates the approvers/notifiers/observers
while doing this we need few fields to be automatically completed
For Example
Criteria 1 – Fields F1,F2,F3 – Approvers 1
Criteria 2 – Fields F5,F6 – Approvers 2
Criteria 3 – Fields F10,F11 – Approvers 3
If matching criteria is Criteria 2 then Fields F5 and F6 should be set to certain values automatically
Could you please help me in this direction
If you want this to be dynamic i.e. there are many criterias in your workflow and your px should dynamically determine that then you need to get the criteria object (ICriteria), get the condition and validate the rule against your change object. If your list of criterias are going to be just 5 or 10 then just hardcode those conditions in your program and on the next status you can just validate condition A/B/C/D and populate the attribute values dynamically. Hope this helps..