flowable/flowable-engine · error · FlowableIllegalArgumentException

name is null

Error message

name is null

What it means

GetGroupsWithPrivilegeCmd's constructor requires the privilege name to be non-null, since groups are queried by their association to a named privilege. A null name triggers FlowableIllegalArgumentException before execution.

Source

Thrown at modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/GetGroupsWithPrivilegeCmd.java:36

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 Joram Barrez
 */
public class GetGroupsWithPrivilegeCmd implements Command<List<Group>>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String name;

    public GetGroupsWithPrivilegeCmd(String name) {
        if (name == null) {
            throw new FlowableIllegalArgumentException("name is null");
        }
        this.name = name;
    }

    @Override
    public List<Group> execute(CommandContext commandContext) {
        return CommandContextUtil.getGroupEntityManager(commandContext).findGroupsByPrivilegeId(name);
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid non-null privilege name to IdentityService.getGroupsWithPrivilege().
  2. Ensure the privilege name matches an existing privilege (createPrivilegeQuery().privilegeName(name)).
  3. Validate the selection in the UI/API layer before querying.
  4. Catch FlowableIllegalArgumentException and show a 'privilege name required' message.

Example fix

// before
List<Group> groups = identityService.getGroupsWithPrivilege(privilegeName); // may be null

// after
if (privilegeName == null || privilegeName.isEmpty()) {
    throw new IllegalArgumentException("privilege name is required");
}
List<Group> groups = identityService.getGroupsWithPrivilege(privilegeName);
Defensive patterns

Strategy: validation

Validate before calling

if (privilegeName == null || privilegeName.isEmpty()) {
    throw new IllegalArgumentException("privilege name must be provided before querying groups");
}

Type guard

boolean hasValidPrivilegeName(String name) {
    return name != null && !name.isEmpty();
}

Try / catch

try {
    List<Group> groups = identityService.getGroupsWithPrivilege(privilegeName);
} catch (FlowableIllegalArgumentException e) {
    if (e.getMessage().contains("name is null")) {
        throw new InvalidRequestException("Privilege name must not be null");
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling IdentityService.getGroupsWithPrivilege(null) or constructing new GetGroupsWithPrivilegeCmd(null) while listing groups that hold a given privilege.

Common situations: Admin consoles rendering privilege-to-group mappings where the selected privilege is null (nothing selected); privilege names refactored/renamed so the constant is no longer set; property-driven privilege config that is empty.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/1f325b3cd392d8b0. Report an issue: GitHub.