Bug 1263331 - Command classes returning null should fail more gracefully
Summary: Command classes returning null should fail more gracefully
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.1.0
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ER5
: 6.2.0
Assignee: Alessandro Lazarotti
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-15 14:46 UTC by cshumake
Modified: 2020-03-27 20:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:10:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description cshumake 2015-09-15 14:46:58 UTC
Description of problem:
When creating custom Command classes for the AsyncWorkItemHandler, there is an implicit requirement to return at least a new ExecutionResults() instance. This may be documented but returning null causes a strange issue. The process instance will remain active with the RequestInfo object in Error state. The ErrorInfo table will list a null pointer exception in AvailableJobsExecutor but the rest of the trace is in the container and reflective libraries so is unhelpful.

This happened with embedded jBPM.


Version-Release number of selected component (if applicable):
6.2.0 Maven dependencies, I believe this maps to earlier versions.

How reproducible:
Simple, easy

Steps to Reproduce:
1. Setup a simple jBPM app with the services API.
2. Register the AsyncWorkItemHandler in a WID.
3. Create a process using the async task node and pass a command class.
4. Create the command class and make it return null in the execute() method.

Actual results:
jBPM logs an ambiguous record in the ErrorInfo table, the Command class is invoked up to the retry limit, no exception is thrown or logged, process instances remain active, the RequestInfo table shows the request in Error state

Expected results:
An exception is thrown (or at least logged at ERROR level) immediately to notify the user of an invalid method return value or the null return value is handled.

Additional info:

Comment 2 Maciej Swiderski 2015-10-01 13:42:45 UTC
fixed by making null returned from command as valid return value
committed only to master as it has no flag for 6.2, in case it should be back ported to 6.3.x branch please assign it back to me

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/a6250d83dbba3822b6e007bce1c79d373a2c4202

Comment 3 Radovan Synek 2015-11-02 09:18:59 UTC
This issue hasn't been fixed for 6.2.0 release - see the comment 2; marking as modified.


Note You need to log in before you can comment on or make changes to this bug.