{"record":{"id":"780a6ce8f9e0ec29","repo":"flowable/flowable-engine","slug":"groupid-is-null-780a6c","errorCode":null,"errorMessage":"groupId is null","messagePattern":"groupId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/DeleteGroupCmd.java","lineNumber":37,"sourceCode":"import org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.idm.engine.impl.util.CommandContextUtil;\n\n/**\n * @author Tom Baeyens\n */\npublic class DeleteGroupCmd implements Command<Void>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    String groupId;\n\n    public DeleteGroupCmd(String groupId) {\n        this.groupId = groupId;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"groupId is null\");\n        }\n        CommandContextUtil.getGroupEntityManager(commandContext).delete(groupId);\n\n        return null;\n    }\n\n}\n","sourceCodeStart":19,"sourceCodeEnd":45,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/cmd/DeleteGroupCmd.java#L19-L45","documentation":"DeleteGroupCmd.execute() checks that the groupId field is non-null before delegating to the GroupEntityManager. A null groupId would be an invalid delete key, so the command throws FlowableIllegalArgumentException at execution time.","triggerScenarios":"Executing new DeleteGroupCmd(null) directly, or calling IdentityService.deleteGroup(null) which builds this command with a null group id.","commonSituations":"Group id lost when copying from a DTO or form submission; deleting in a loop where one iteration's id is null because the group was not found earlier; hardcoded cleanup scripts referencing a group that was never created.","solutions":["Pass a non-null groupId to IdentityService.deleteGroup() / DeleteGroupCmd.","Verify the group exists (createGroupQuery().groupId(id).singleResult() != null) before deleting.","In batch deletes, filter out null ids before issuing delete calls.","Catch FlowableIllegalArgumentException and surface a 'group id required' validation message to the caller."],"exampleFix":"// before\nidentityService.deleteGroup(groupId); // groupId may be null\n\n// after\nif (groupId != null) {\n    identityService.deleteGroup(groupId);\n}","handlingStrategy":"validation","validationCode":"if (groupId == null || groupId.isEmpty()) {\n    throw new IllegalArgumentException(\"groupId must be provided before deleting a group\");\n}","typeGuard":"boolean hasValidGroupId(String groupId) {\n    return groupId != null && !groupId.isEmpty();\n}","tryCatchPattern":"try {\n    identityService.deleteGroup(groupId);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"groupId is null\")) {\n        throw new InvalidRequestException(\"Group id must not be null\");\n    }\n    throw e;\n}","preventionTips":["Check group existence with a query before delete operations.","Filter null ids out of batch delete loops.","Validate form/path parameters before mapping them to engine calls.","Log the originating id variable when deletion fails so null sources are traceable."],"tags":["flowable","idm","null-check","group"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}