{"record":{"id":"bbf99890cfec4be1","repo":"flowable/flowable-engine","slug":"historyjobid-is-null-bbf998","errorCode":null,"errorMessage":"historyJobId is null","messagePattern":"historyJobId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/GetHistoryJobAdvancedConfigurationCmd.java","lineNumber":45,"sourceCode":" * \n * @author Joram Barrez\n */\npublic class GetHistoryJobAdvancedConfigurationCmd implements Command<String> {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(GetHistoryJobAdvancedConfigurationCmd.class);\n\n    protected JobServiceConfiguration jobServiceConfiguration;\n    protected String historyJobId;\n\n    public GetHistoryJobAdvancedConfigurationCmd(String historyJobId, JobServiceConfiguration jobServiceConfiguration) {\n        this.historyJobId = historyJobId;\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    @Override\n    public String execute(CommandContext commandContext) {\n        if (historyJobId == null) {\n            throw new FlowableIllegalArgumentException(\"historyJobId is null\");\n        }\n\n        HistoryJobEntity historyJobEntity = jobServiceConfiguration.getHistoryJobEntityManager().findById(historyJobId);\n        if (historyJobEntity == null) {\n            throw new JobNotFoundException(historyJobId);\n        }\n        return historyJobEntity.getAdvancedJobHandlerConfiguration();\n    }\n\n}\n","sourceCodeStart":27,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/GetHistoryJobAdvancedConfigurationCmd.java#L27-L56","documentation":"GetHistoryJobAdvancedConfigurationCmd throws FlowableIllegalArgumentException when historyJobId is null, then loads the history job and throws JobNotFoundException when missing. It returns the advanced configuration (handler-specific JSON) for a history job, which requires a valid id.","triggerScenarios":"managementService.getHistoryJobAdvancedConfiguration(null) or executing the command with a null id; querying a deleted history job id.","commonSituations":"Admin tooling inspecting async history jobs where the id was taken from an empty/optional result; ids reused after history job cleanup removed the row.","solutions":["Obtain the id from a HistoryJobQuery result and check it is non-null before calling.","Catch FlowableObjectNotFoundException/JobNotFoundException when the job may have been cleaned up.","Verify the history job still exists in ACT_RU_HISTORY_JOB (cleanup jobs may have removed it).","In tooling, render a friendly 'not found' message instead of letting the exception propagate."],"exampleFix":"// before\nString cfg = managementService.getHistoryJobAdvancedConfiguration(historyJobId);\n// after\nHistoryJob job = managementService.createHistoryJobQuery().jobId(historyJobId).singleResult();\nif (job != null) {\n    String cfg = managementService.getHistoryJobAdvancedConfiguration(historyJobId);\n}","handlingStrategy":"validation","validationCode":"HistoryJob job = managementService.createHistoryJobQuery().jobId(historyJobId).singleResult();\nif (job == null) { return null; } // or friendly error","typeGuard":null,"tryCatchPattern":"try { return managementService.getHistoryJobAdvancedConfiguration(id); } catch (FlowableObjectNotFoundException e) { return null; }","preventionTips":["Resolve ids via HistoryJobQuery before advanced-configuration lookups.","Account for history job cleanup jobs removing rows unexpectedly.","Return friendly messages in admin UIs instead of raw exceptions."],"tags":["flowable","job-service","null-argument","history-job"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}