Home > Forum > Rules, JS, SQL > Error when using business rule in SQL query

Error when using business rule in SQL query
1

Hi guys,

I'm trying to cyclically start new elements in BPS based on data retrieved from another system. I already have an endpoint that returns the required data.

To achieve this, I planned to use a global action (cyclical). First, I created a business rule that fetches the data using a REST API. Then, I wrote an SQL query that utilized this business rule to retrieve the data.

However, when testing it, I keep encountering the following error:

WebCon.WorkFlow.BusinessLogic.BusinessRules.Exceptions.BusinessRuleEvaluationException: Error occurred during rule SQL Fetch contractors with debt (Id: 5834) evaluation.
---> System.Exception: Error getting data for DataSource name: Windykacja - Fetch debtors ID: 3371
---> System.ArgumentNullException: Value cannot be null. (Parameter 'tokensContainer')

It's worth mentioning that the business rule itself works correctly and doesn't return this error when executed independently.

I’m attaching a screenshot of the business rule configuration, the SQL query, and the full error log.

I’d be very grateful for your help :)

WEBCON

Hi,

Thank you for reaching out.
We’ve reviewed your case but were unable to reproduce the issue using the latest versions (2024.1.1.274 and 2025.2.1.91).

We recommend updating to the most recent version. If the problem persists after the upgrade, please provide us with additional details or contact our support team directly—we’ll be happy to assist further.

Best regards,
Łukasz

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings