YunaiV/yudao-cloud · error · UnsupportedOperationException

不支持的延迟类型:{}

Error message

不支持的延迟类型:{}

What it means

While converting a BPM simple-model DELAY_TIMER_NODE to Flowable BPMN, SimpleModelUtils throws UnsupportedOperationException when delaySetting.delayType is neither FIXED_DATE_TIME (delay until an absolute time) nor FIXED_TIME_TIME_DURATION — here FIXED_TIME_DURATION (delay by a duration). The two supported types map to a Timer Boundary Event with a timeDate vs timeDuration expression; any other value has no BPMN representation in this converter.

Source

Thrown at yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java:744

        public List<FlowElement> convertList(BpmSimpleModelNodeVO node) {
            List<FlowElement> flowElements = new ArrayList<>(2);
            // 1. 构建接收任务,通过接收任务可卡住节点
            ReceiveTask receiveTask = new ReceiveTask();
            receiveTask.setId(node.getId());
            receiveTask.setName(node.getName());
            flowElements.add(receiveTask);

            // 2. 添加接收任务的 Timer Boundary Event
            if (node.getDelaySetting() != null) {
                BoundaryEvent boundaryEvent = null;
                if (node.getDelaySetting().getDelayType().equals(BpmDelayTimerTypeEnum.FIXED_DATE_TIME.getType())) {
                    boundaryEvent = buildTimeoutBoundaryEvent(receiveTask, BpmBoundaryEventTypeEnum.DELAY_TIMER_TIMEOUT.getType(),
                            null, null, node.getDelaySetting().getDelayTime());
                } else if (node.getDelaySetting().getDelayType().equals(BpmDelayTimerTypeEnum.FIXED_TIME_DURATION.getType())) {
                    boundaryEvent = buildTimeoutBoundaryEvent(receiveTask, BpmBoundaryEventTypeEnum.DELAY_TIMER_TIMEOUT.getType(),
                            node.getDelaySetting().getDelayTime(), null, null);
                } else {
                    throw new UnsupportedOperationException("不支持的延迟类型:" + node.getDelaySetting());
                }
                flowElements.add(boundaryEvent);
            }
            return flowElements;
        }

        @Override
        public BpmSimpleModelNodeTypeEnum getType() {
            return BpmSimpleModelNodeTypeEnum.DELAY_TIMER_NODE;
        }
    }

    public static class TriggerNodeConvert implements NodeConvert {

        @Override
        public List<? extends FlowElement> convertList(BpmSimpleModelNodeVO node) {
            Assert.notNull(node.getTriggerSetting(), "触发器节点设置不能为空");
            List<FlowElement> flowElements = new ArrayList<>(2);

View on GitHub (pinned to 477be9dd49)

Solutions

  1. Set delayType to 1 (FIXED_DATE_TIME) or 2 (FIXED_TIME_DURATION) on the delay node in the designer
  2. Upgrade the BPM server module to the version whose enum covers the delay type the designer emits
  3. Ensure the frontend always sends a delayType whenever a delaySetting object is attached

Example fix

// before (process JSON node)
{"type":"DELAY_TIMER_NODE","delaySetting":{"delayType":null,"delayTime":"PT10M"}}

// after
{"type":"DELAY_TIMER_NODE","delaySetting":{"delayType":2,"delayTime":"PT10M"}} // 2 = FIXED_TIME_DURATION
Defensive patterns

Strategy: validation

Validate before calling

Integer t = node.getDelaySetting() != null ? node.getDelaySetting().getDelayType() : null;
if (t == null || !(t.equals(BpmDelayTimerTypeEnum.FIXED_DATE_TIME.getType())
        || t.equals(BpmDelayTimerTypeEnum.FIXED_TIME_DURATION.getType()))) {
    throw new IllegalArgumentException("delayType 必须为 1(固定时间点) 或 2(固定时长)");
}

Type guard

boolean isValidDelayType(Integer delayType) {
    return delayType != null && Arrays.stream(BpmDelayTimerTypeEnum.values())
        .anyMatch(e -> e.getType().equals(delayType));
}

Prevention

When it happens

Trigger: A delay timer node in the simple designer whose delayType is null or an out-of-range integer (e.g. 3+); process JSON imported from a version whose BpmDelayTimerTypeEnum defines more types than the deployed server supports; delaySetting present but delayType left unset by the frontend.

Common situations: Frontend designer newer than backend server (extra delay types); manually crafted simple-model JSON; partial save leaving delayType null while delaySetting object exists.

Related errors


AI-assisted analysis of YunaiV/yudao-cloud@477be9dd49 (2026-08-14). Data as JSON: /api/errors/87b08e7deda10953. Report an issue: GitHub.