{"record":{"id":"8afb5a0dc6bb5370","repo":"flowable/flowable-engine","slug":"groupid-is-null-8afb5a","errorCode":null,"errorMessage":"groupId is null","messagePattern":"groupId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/CreateGroupCmd.java","lineNumber":35,"sourceCode":"\nimport org.flowable.common.engine.api.FlowableIllegalArgumentException;\nimport org.flowable.common.engine.impl.interceptor.Command;\nimport org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.idm.api.Group;\nimport org.flowable.idm.engine.impl.util.CommandContextUtil;\n\n/**\n * @author Tom Baeyens\n */\npublic class CreateGroupCmd implements Command<Group>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String groupId;\n\n    public CreateGroupCmd(String groupId) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"groupId is null\");\n        }\n        this.groupId = groupId;\n    }\n\n    @Override\n    public Group execute(CommandContext commandContext) {\n        return CommandContextUtil.getGroupEntityManager(commandContext).createNewGroup(groupId);\n    }\n\n}\n","sourceCodeStart":17,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/CreateGroupCmd.java#L17-L46","documentation":"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.","triggerScenarios":"Calling new CreateGroupCmd(null), typically indirectly via an API path that passes a null id into group creation.","commonSituations":"Programmatic group provisioning where the id is generated or read from an upstream record that has no id yet.","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."],"exampleFix":"// before\nGroup g = identityService.newGroup(sourceGroup.getName()); // getName() is null\n// after\nString groupId = sourceGroup.getName() != null ? sourceGroup.getName() : UUID.randomUUID().toString();\nGroup g = identityService.newGroup(groupId);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(groupId, \"groupId must not be null\"); identityService.newGroup(groupId);","typeGuard":"boolean validGroupId(String id) { return id != null && !id.isBlank(); }","tryCatchPattern":"try { identityService.newGroup(groupId); } catch (FlowableIllegalArgumentException e) { throw new IllegalArgumentException(\"Group id required\", e); }","preventionTips":["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"],"tags":["flowable","idm","null-argument","group","command"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}