Skip to Content

SCP Workflow API - filter by custom attribute for multiple workflow definitions

Hi,

I have 2 workflows A and B. And in workflow A, I assign a custom attribute EmployeeNo.

I'm using workflow API on Neo to query workflow instances - /v1/workflow-instances

I need to get workflow instances of A and B, with filter custom attribute EmployeeNo which belongs to A, so the complete request would be

/v1/workflow-instances?$top=1&$inlinecount=allpages&definitionId=A,B&attributes.EmployeeNo=123456789

I'm not sure how the API handles the attribute filter.

1. Does it know that EmployeeNo belongs to A, not B?

2. Does it have a same result like 2 separate calls like?

/v1/workflow-instances?$top=1&$inlinecount=allpages&definitionId=A&attributes.EmployeeNo=123456789
/v1/workflow-instances?$top=1&$inlinecount=allpages&definitionId=B

And another thing is should the value of attributes be enclosed by single quote?

Thanks.

Tri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 24, 2020 at 10:26 AM

    Hi Tri,

    the general logic of filters on different attributes is that they have to match all (AND logic), while multiple values for a single attribute are ORed. Your query is therefore:

    (match the custom attribute value) AND (come from either A OR B definition)

    So the first URL will rather have the same results as the second if B has no such employeeNo attribute, but not include results from your third one. You have to execute several calls and merge the results, if the attribute does not exist for both A and B.

    Only the usual URL escaping rules apply, so unless the value really contains single quotes, you do not specify them.

    Regards,

    Tobias

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.