{"record":{"id":"91c837ab457dcccb","repo":"flowable/flowable-engine","slug":"support-for-specifying-both-a-day-of-week-and-a-da","errorCode":null,"errorMessage":"Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.","messagePattern":"Support for specifying both a day-of-week AND a day-of-month parameter is not implemented\\.","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java","lineNumber":532,"sourceCode":"\n            if (exprOn <= DAY_OF_WEEK) {\n                throw new ParseException(\"Unexpected end of expression.\", expression.length());\n            }\n\n            if (exprOn <= YEAR) {\n                storeExpressionVals(0, \"*\", YEAR);\n            }\n\n            TreeSet<Integer> dow = getSet(DAY_OF_WEEK);\n            TreeSet<Integer> dom = getSet(DAY_OF_MONTH);\n\n            // Copying the logic from the UnsupportedOperationException below\n            boolean dayOfMSpec = !dom.contains(NO_SPEC);\n            boolean dayOfWSpec = !dow.contains(NO_SPEC);\n\n            if (!dayOfMSpec || dayOfWSpec) {\n                if (!dayOfWSpec || dayOfMSpec) {\n                    throw new ParseException(\n                            \"Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.\",\n                            0);\n                }\n            }\n        } catch (ParseException pe) {\n            throw pe;\n        } catch (Exception e) {\n            throw new ParseException(\"Illegal cron expression format (\" + e + \")\", 0);\n        }\n    }\n\n    protected int storeExpressionVals(int pos, String s, int type) throws ParseException {\n\n        int incr = 0;\n        int i = skipWhiteSpace(pos, s);\n        if (i >= s.length()) {\n            return i;\n        }","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/calendar/CronExpression.java#L514-L550","documentation":"This cron dialect does not allow specifying both day-of-month and day-of-week as restricted values; one of them must be '?'. buildExpression computes dayOfMSpec/dayOfWSpec from whether the sets contain NO_SPEC, and throws this ParseException when both are specified (and also when neither is, given the nested condition structure).","triggerScenarios":"new CronExpression(expr, clockReader) where the 3rd and 6th fields both contain concrete values, e.g. '0 0 12 15 * FRI'; the same path is hit via readObject during deserialization.","commonSituations":"Users writing '0 0 0 1 * MON' expecting OR semantics (unix cron behavior) instead of the Quartz rule; migrating expressions from Unix cron to Flowable/Quartz cron without changing the day fields.","solutions":["Replace the less relevant day field with '?': '0 0 12 15 * ?' or '0 0 12 ? * FRI'","Decide whether the schedule means 'day of month' or 'day of week' and keep only one","If OR semantics are needed, create two schedules and union the triggers","Note this differs from standard Unix cron — document the dialect for config authors"],"exampleFix":"// before\nString cron = \"0 0 12 15 * FRI\"; // both dom and dow restricted\n// after\nString cron = \"0 0 12 15 * ?\"; // 15th of every month (or '0 0 12 ? * FRI' for Fridays)","handlingStrategy":"validation","validationCode":"boolean domSet = !fields[2].equals(\"?\") && !fields[2].equals(\"*\");\nboolean dowSet = !fields[5].equals(\"?\") && !fields[5].equals(\"*\");\nif (domSet && dowSet) throw new IllegalArgumentException(\"specify only one of day-of-month or day-of-week, use '?' for the other\");","typeGuard":null,"tryCatchPattern":"try { new CronExpression(expr, clockReader); }\ncatch (ParseException e) { if (e.getMessage().contains(\"day-of-week AND a day-of-month\")) { /* set one field to '?' */ } throw e; }","preventionTips":["Always write '?' in one of the two day fields in Quartz-style cron","Do not assume Unix cron OR semantics when migrating","Lint BPMN timer definitions for day-field conflicts at build time"],"tags":["cron","format","flowable","quartz"],"backgroundTag":"conflicting-config-options","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"}