{"record":{"id":"62913b1e6f040998","repo":"flowable/flowable-engine","slug":"caseinstanceid-is-required-62913b","errorCode":null,"errorMessage":"caseInstanceId is required","messagePattern":"caseInstanceId is required","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetHistoricIdentityLinksForCaseInstanceCmd.java","lineNumber":37,"sourceCode":"import org.flowable.cmmn.engine.impl.util.CommandContextUtil;\nimport org.flowable.common.engine.api.FlowableIllegalArgumentException;\nimport org.flowable.common.engine.api.scope.ScopeTypes;\nimport org.flowable.common.engine.impl.interceptor.Command;\nimport org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.identitylink.api.history.HistoricIdentityLink;\n\n/**\n * @author Tijs Rademakers\n */\npublic class GetHistoricIdentityLinksForCaseInstanceCmd implements Command<List<HistoricIdentityLink>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    \n    protected String caseInstanceId;\n\n    public GetHistoricIdentityLinksForCaseInstanceCmd(String caseInstanceId) {\n        if (caseInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"caseInstanceId is required\");\n        }\n        this.caseInstanceId = caseInstanceId;\n    }\n\n    @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n    @Override\n    public List<HistoricIdentityLink> execute(CommandContext commandContext) {\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        return (List) cmmnEngineConfiguration.getIdentityLinkServiceConfiguration().getHistoricIdentityLinkService()\n                .findHistoricIdentityLinksByScopeIdAndScopeType(caseInstanceId, ScopeTypes.CMMN);\n    }\n\n}\n","sourceCodeStart":19,"sourceCodeEnd":51,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetHistoricIdentityLinksForCaseInstanceCmd.java#L19-L51","documentation":"GetHistoricIdentityLinksForCaseInstanceCmd retrieves historic identity links (users/groups involved) for a case instance. Its constructor throws FlowableIllegalArgumentException when caseInstanceId is null; Flowable validates command arguments at construction time to fail fast.","triggerScenarios":"Calling new GetHistoricIdentityLinksForCaseInstanceCmd(null) or a service API (e.g. CmmnHistoryService) forwarding a null caseInstanceId from a nullable variable or request parameter.","commonSituations":"Id taken from a process/param map that lacks the key, confusing caseInstanceId with caseDefinitionId, or null from a prior query result.","solutions":["Supply a valid non-null caseInstanceId.","Validate the id at the service boundary before calling the history API.","Confirm the source variable name actually holds the case instance id."],"exampleFix":"// before\ncmmnHistoryService.getHistoricIdentityLinksForCaseInstance(params.get(\"id\"));\n// after\nString id = params.get(\"id\");\nif (id == null) {\n    throw new IllegalArgumentException(\"caseInstanceId must be provided\");\n}\ncmmnHistoryService.getHistoricIdentityLinksForCaseInstance(id);","handlingStrategy":"validation","validationCode":"if (caseInstanceId == null || caseInstanceId.isEmpty()) { throw new IllegalArgumentException(\"caseInstanceId must be provided\"); }","typeGuard":"boolean isNonEmptyId = s != null && !s.isEmpty();","tryCatchPattern":"try { ... } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(e.getMessage()); }","preventionTips":["Distinguish caseInstanceId from caseDefinitionId in your code","Validate ids at API boundaries","Never pass raw map.get values into engine commands"],"tags":["flowable","cmmn","null-argument","validation"],"backgroundTag":"missing-required-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"}