Skip to content

Ensure process ID and identifier are non-empty in case creation.#412

Merged
machacjozef merged 1 commit intorelease/7.0.0-rev10from
fix/7.0.0_rev10_test_fixes
Feb 5, 2026
Merged

Ensure process ID and identifier are non-empty in case creation.#412
machacjozef merged 1 commit intorelease/7.0.0-rev10from
fix/7.0.0_rev10_test_fixes

Conversation

@renczesstefan
Copy link
Member

@renczesstefan renczesstefan commented Feb 5, 2026

Description

Updated empty string handling when creating new cases and added additional global function cache loading before executing pre-upload events.

Dependencies

No new dependencies were introduced

Third party dependencies

No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

This was tested manually and with unit tests.

Test Configuration

Name Tested on
OS macOS Tahoe 26.2
Runtime Java 21
Dependency Manager Maven 3.9.9n
Framework version Spring Boot 3.4.4
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @machacjozef
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of process references to reject empty values in addition to null values, ensuring more robust error handling and preventing invalid cases from being processed.

Refine condition checks by validating that `processId` and `processIdentifier` are not empty strings. This prevents potential issues caused by invalid or incomplete input during case creation.
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Walkthrough

Adds non-empty string validation to process references in the fillAndValidateAttributes method of WorkflowService.java. When processing processId or processIdentifier parameters, the method now validates that these values are not only non-null but also non-empty before attempting to resolve the corresponding PetriNet or origin net.

Changes

Cohort / File(s) Summary
Process Reference Validation
application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java
Added non-empty string validation checks for processId and processIdentifier parameters to prevent resolution attempts with blank values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

bugfix, Extra Small

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding validation to ensure process ID and identifier are non-empty strings during case creation, which directly aligns with the primary modification in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added bugfix A change that fixes a bug Extra Small labels Feb 5, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java`:
- Around line 343-345: The validation currently uses String.isEmpty() on
createCaseParams.getProcessId() and createCaseParams.getProcessIdentifier()
which allows whitespace-only values to pass; change those checks to use
String.isBlank() so whitespace-only strings are treated as empty and handled the
same way (update the if condition around createCaseParams.getProcessId() and the
else-if for createCaseParams.getProcessIdentifier() in WorkflowService methods
that construct new ObjectId(createCaseParams.getProcessId()) / call
petriNetService.get()).

@machacjozef machacjozef merged commit 675a6f0 into release/7.0.0-rev10 Feb 5, 2026
6 of 7 checks passed
@machacjozef machacjozef deleted the fix/7.0.0_rev10_test_fixes branch February 5, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes a bug Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants