Skip to content

Commit be42dc6

Browse files
refactor(business-rules): name the rule's input input throughout
The internal helpers take it as input, the same name as run()'s parameter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4ea997f commit be42dc6

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

‎packages/uipath-platform/src/uipath/platform/business_rules/_business_rules_service.py‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async def run_async(
190190
def _prepare_run(
191191
self,
192192
business_rule_name: str,
193-
rule_input: Dict[str, Any],
193+
input: Dict[str, Any],
194194
folder_key: Optional[str],
195195
folder_path: Optional[str],
196196
) -> _RunTarget:
@@ -202,7 +202,7 @@ def _prepare_run(
202202
business_rule_name, folder_key, folder_path = self._apply_binding(
203203
business_rule_name, folder_key, folder_path
204204
)
205-
_validate_run_arguments(business_rule_name, rule_input)
205+
_validate_run_arguments(business_rule_name, input)
206206
selected_key, selected_path = self._select_folder(folder_key, folder_path)
207207
return _RunTarget(
208208
business_rule_name=business_rule_name,
@@ -288,7 +288,7 @@ async def _resolve_folder_key_async(self, run_target: _RunTarget) -> str:
288288
def _evaluate_spec(
289289
self,
290290
business_rule_name: str,
291-
rule_input: Dict[str, Any],
291+
input: Dict[str, Any],
292292
*,
293293
folder_key: str,
294294
version: Optional[str] = None,
@@ -299,7 +299,7 @@ def _evaluate_spec(
299299
# and audit record under it.
300300
request_body: Dict[str, Any] = {
301301
"businessRuleName": business_rule_name,
302-
"input": rule_input,
302+
"input": input,
303303
}
304304
if _has_value(version):
305305
request_body["version"] = version
@@ -385,11 +385,9 @@ def _has_value(text: Optional[str]) -> bool:
385385
return bool(text and text.strip())
386386

387387

388-
def _validate_run_arguments(
389-
business_rule_name: str, rule_input: Dict[str, Any]
390-
) -> None:
388+
def _validate_run_arguments(business_rule_name: str, input: Dict[str, Any]) -> None:
391389
_validate_business_rule_name(business_rule_name)
392-
_validate_input(rule_input)
390+
_validate_input(input)
393391

394392

395393
def _validate_business_rule_name(business_rule_name: str) -> None:
@@ -408,15 +406,15 @@ def _validate_business_rule_name(business_rule_name: str) -> None:
408406
raise ValueError("name must not contain control characters")
409407

410408

411-
def _validate_input(rule_input: Dict[str, Any]) -> None:
412-
if rule_input is None:
409+
def _validate_input(input: Dict[str, Any]) -> None:
410+
if input is None:
413411
raise ValueError("input must not be None")
414-
if not isinstance(rule_input, Mapping):
412+
if not isinstance(input, Mapping):
415413
raise ValueError(
416414
"input must be a mapping of the rule's input names to values, "
417-
f"not {type(rule_input).__name__}"
415+
f"not {type(input).__name__}"
418416
)
419-
if len(rule_input) > _MAX_INPUT_KEYS:
417+
if len(input) > _MAX_INPUT_KEYS:
420418
raise ValueError(f"input must not exceed {_MAX_INPUT_KEYS} keys")
421419

422420

0 commit comments

Comments
 (0)