Is there any way i can filter variable instances based on the attributes of the object. For example, i want to search something like this: customerDetails.custId=123
@Ingo_Richtsmeier My original requirement is to fetch process instances based on the search filters using camunda rest APIs. For example, i would like to filter process instances based on its variables. In my case, I want to find out process instances that are created for a particular customer i.e customerDetails.custId=12345 or any other such parameter of a customer object. Is it possible ?
AFAIK you can only filter process instances by top level variables; preferrably strings, but other atomic types (e.g. integer) might works as well – you’ll have to check.
// if you want to do search based on another attribute of customer say “accountNumber”
execution.setVariable(“accountNumber”, customerDetails.get(“accountNumber”));
Now, you can fetch process instances based on “customerId” variable. For example:
Please note that you need to provide variable name and value in the format “customerId_eq_12345”. Here “eq” is for “equals”.
If you want to filter process instances based on multiple customerDetails attribute, then you would have to create that many process variables in the same way as described in point 1.
@garima And also, do you have an idea on how we can enforce the engine to validate the request parameters when the camunda rest api is invoked? For example, i would like to update the variables using the camunda rest api with a check on the input data. Is this possible?