flowable/flowable-engine · error · FlowableIllegalArgumentException
groupId is null
Error message
groupId is null
What it means
CreateGroupCmd's constructor throws FlowableIllegalArgumentException when the groupId is null. This command backs IdentityService.newGroup(...)/createGroup; constructing it without a group id can never succeed, so validation happens at construction time, before any command execution.
Source
Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/CreateGroupCmd.java:35
import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.idm.api.Group;
import org.flowable.idm.engine.impl.util.CommandContextUtil;
/**
* @author Tom Baeyens
*/
public class CreateGroupCmd implements Command<Group>, Serializable {
private static final long serialVersionUID = 1L;
protected String groupId;
public CreateGroupCmd(String groupId) {
if (groupId == null) {
throw new FlowableIllegalArgumentException("groupId is null");
}
this.groupId = groupId;
}
@Override
public Group execute(CommandContext commandContext) {
return CommandContextUtil.getGroupEntityManager(commandContext).createNewGroup(groupId);
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Pass a non-null, unique group id string when creating the command.
- Generate an id before construction (e.g. UUID.randomUUID().toString()) if the source record has none.
- Validate inputs at the service boundary before invoking IdentityService group-creation APIs.
Example fix
// before Group g = identityService.newGroup(sourceGroup.getName()); // getName() is null // after String groupId = sourceGroup.getName() != null ? sourceGroup.getName() : UUID.randomUUID().toString(); Group g = identityService.newGroup(groupId);
Defensive patterns
Strategy: validation
Validate before calling
Objects.requireNonNull(groupId, "groupId must not be null"); identityService.newGroup(groupId);
Type guard
boolean validGroupId(String id) { return id != null && !id.isBlank(); } Try / catch
try { identityService.newGroup(groupId); } catch (FlowableIllegalArgumentException e) { throw new IllegalArgumentException("Group id required", e); } Prevention
- Generate ids (UUID) when the source record has none
- Validate identifiers before calling IDM APIs
- Require non-blank ids in upstream DTOs via bean validation
When it happens
Trigger: Calling new CreateGroupCmd(null), typically indirectly via an API path that passes a null id into group creation.
Common situations: Programmatic group provisioning where the id is generated or read from an upstream record that has no id yet.
Related errors
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/8afb5a0dc6bb5370.
Report an issue: GitHub.