openxiangda 2.25.3 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/resource/useResourceFormDrafts.d.ts.map +1 -1
- package/dist/browser/components/workflow/StandardWorkflowPages.d.ts.map +1 -1
- package/dist/browser/components/workflow/StandardWorkflowPages.js +145 -16
- package/dist/browser/components/workflow/StandardWorkflowPages.js.map +1 -1
- package/dist/browser/platform-client.d.ts +25 -1
- package/dist/browser/platform-client.d.ts.map +1 -1
- package/dist/browser/platform-client.js +62 -27
- package/dist/browser/platform-client.js.map +1 -1
- package/dist/browser/workflow-submission-recovery.d.ts +16 -0
- package/dist/browser/workflow-submission-recovery.d.ts.map +1 -0
- package/dist/browser/workflow-submission-recovery.js +56 -0
- package/dist/browser/workflow-submission-recovery.js.map +1 -0
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/nest.d.ts +2 -2
- package/dist/nest.d.ts.map +1 -1
- package/dist/nest.js +1 -1
- package/dist/nest.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/documentation/backend.md +44 -13
- package/documentation/decimal-reservations.md +111 -0
- package/documentation/getting-started.md +7 -7
- package/documentation/manifest.json +11 -5
- package/documentation/testing.md +15 -0
- package/documentation/upgrading.md +12 -0
- package/package.json +28 -22
- package/releases/2.26.0.json +41 -0
- package/releases/2.27.0.json +38 -0
- package/skills/manifest.json +1 -1
- package/skills/openxiangda-v2/SKILL.md +5 -4
- package/skills/openxiangda-v2/references/backend.md +44 -13
- package/skills/openxiangda-v2/references/decimal-reservations.md +111 -0
- package/skills/openxiangda-v2/references/getting-started.md +7 -7
- package/skills/openxiangda-v2/references/testing.md +15 -0
- package/skills/openxiangda-v2/references/upgrading.md +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResourceFormDrafts.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/resource/useResourceFormDrafts.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAWpD,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE;IAC/I,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,YAAY,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IACrI,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrF,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,IAAI,IAAI,CAAC;CACnF;;;;;;;;;;;;;;0BA+
|
|
1
|
+
{"version":3,"file":"useResourceFormDrafts.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/resource/useResourceFormDrafts.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAWpD,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE;IAC/I,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,YAAY,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IACrI,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrF,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,IAAI,IAAI,CAAC;CACnF;;;;;;;;;;;;;;0BA+D8i9E,CAAC;;iBAAgD,CAAC;;;;;;;;;;;;EADhm9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardWorkflowPages.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/workflow/StandardWorkflowPages.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StandardWorkflowPages.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/workflow/StandardWorkflowPages.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAGV,qBAAqB,EACrB,uBAAuB,EAKvB,eAAe,EAGf,gBAAgB,EAChB,4BAA4B,EAG7B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC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OAAmB,GACpB,EAAE;IACD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,2CAEA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,OAAmB,GACpB,EAAE;IACD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,2CAEA;AAOD,wBAAgB,sBAAsB,CAAC,EAAE,OAAmB,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,WAAW,CAAA;CAAE,2CA+DxF;AA4LD,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,YAAY,EAAE,oBAAoB,EAClC,OAAmB,EACnB,SAAS,EACT,WAAW,GACZ,GAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,2UAswBL"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { applicationCode } from '../../runtime-meta';
|
|
3
|
+
import { readPendingWorkflowSubmission, writePendingWorkflowSubmission, clearPendingWorkflowSubmission, workflowSubmissionScope, submissionLocatorStorage, standardProcessWasRejected } from '../../workflow-submission-recovery';
|
|
2
4
|
import { PresentationTime, usePresentationTimeZone } from '../../presentation-time';
|
|
3
5
|
import { ArrowLeftOutlined, ClockCircleOutlined, EllipsisOutlined, ReloadOutlined, CloseOutlined, ExpandOutlined, CompressOutlined, ExportOutlined, } from '@ant-design/icons';
|
|
4
6
|
import { Alert, App, Button, Card, Drawer, Empty, Form, Input, Modal, Result, Segmented, Select, Space, Spin, Table, Tabs, Tag, Tooltip, Typography, } from 'antd';
|
|
@@ -7,7 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
|
7
9
|
import { Link, Navigate, useHref, useNavigate, useParams, useSearchParams, } from 'react-router-dom';
|
|
8
10
|
import { PlatformDirectoryPicker } from '../platform-fields/PlatformDirectoryPicker';
|
|
9
11
|
import { directoryStoredValues } from '../platform-fields/directory-value';
|
|
10
|
-
import { executeWorkflowOperation, executeWorkflowLaunchNamedOperation, loadWorkflowInstanceDetail, loadWorkflowRecordDetail, loadWorkflowDataAudit, loadWorkflowInstanceSurface, loadWorkflowLaunchSurface, loadWorkflowTaskSurface, loadWorkflowTaskDetail, loadWorkflowWorkCenter, answerBusinessProcessCommand, commitStandardProcess, createNativeResourceClient, loadProcessCommandSurface, retryBusinessProcessCommand, uploadOperationManagedFile, } from '../../platform-client';
|
|
12
|
+
import { executeWorkflowOperation, executeWorkflowLaunchNamedOperation, loadWorkflowInstanceDetail, loadWorkflowRecordDetail, loadWorkflowDataAudit, loadWorkflowInstanceSurface, loadWorkflowLaunchSurface, loadWorkflowTaskSurface, loadWorkflowTaskDetail, loadWorkflowWorkCenter, answerBusinessProcessCommand, commitStandardProcess, resolveBusinessProcessOriginal, createNativeResourceClient, loadProcessCommandSurface, retryBusinessProcessCommand, uploadOperationManagedFile, } from '../../platform-client';
|
|
11
13
|
import { useWorkflowDefinition, } from '../../workflow-definitions';
|
|
12
14
|
import { useResourceDefinitions } from '../../resource-definitions';
|
|
13
15
|
import { selectedSurfaceFields } from '../resource/resource-field-selection';
|
|
@@ -1041,6 +1043,22 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1041
1043
|
const [completion, setCompletion] = useState(null);
|
|
1042
1044
|
const submitInFlight = useRef(false);
|
|
1043
1045
|
const submissionAttempt = useRef(null);
|
|
1046
|
+
const recoveryScope = workflowSubmissionScope(applicationCode(), identity.environment.key, identity.userId, workflowCode);
|
|
1047
|
+
const activeRecoveryScope = useRef(recoveryScope);
|
|
1048
|
+
activeRecoveryScope.current = recoveryScope;
|
|
1049
|
+
const [pendingSubmission, setPendingSubmission] = useState(() => readPendingWorkflowSubmission(submissionLocatorStorage(), recoveryScope));
|
|
1050
|
+
const [recoveryError, setRecoveryError] = useState(null);
|
|
1051
|
+
const [recoveryObservedAbsent, setRecoveryObservedAbsent] = useState(false);
|
|
1052
|
+
const [recoveryPersisted, setRecoveryPersisted] = useState(true);
|
|
1053
|
+
const originalRetry = useRef(null);
|
|
1054
|
+
const currentWriteContext = JSON.stringify([recoveryScope, identity.environment.activeAppVersionId, identity.environment.headRevision, identity.identityScope]);
|
|
1055
|
+
useEffect(() => {
|
|
1056
|
+
setPendingSubmission(readPendingWorkflowSubmission(submissionLocatorStorage(), recoveryScope));
|
|
1057
|
+
setRecoveryError(null);
|
|
1058
|
+
setRecoveryObservedAbsent(false);
|
|
1059
|
+
setRecoveryPersisted(true);
|
|
1060
|
+
originalRetry.current = null;
|
|
1061
|
+
}, [recoveryScope]);
|
|
1044
1062
|
const completedCommandId = useRef('');
|
|
1045
1063
|
const completionHandler = useRef(onCompleted);
|
|
1046
1064
|
completionHandler.current = onCompleted;
|
|
@@ -1352,6 +1370,88 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1352
1370
|
const dismissDrawer = () => { if (!submitInFlight.current && !drawerBusy)
|
|
1353
1371
|
onDismiss?.(); };
|
|
1354
1372
|
const frame = (content) => onDismiss ? _jsx(Drawer, { open: true, title: definition?.title || '新增流程申请', closable: false, rootClassName: "oxa-resource-drawer oxa-workflow-launch-drawer", size: fullScreen || variant === 'mobile' ? '100vw' : 'min(850px, calc(100vw - 48px))', styles: { body: { padding: 0, overflow: 'auto' } }, keyboard: !drawerBusy, mask: { closable: !drawerBusy }, onClose: dismissDrawer, extra: _jsxs(Space, { size: 4, children: [_jsx(Button, { type: "text", "aria-label": fullScreen ? '退出全屏' : '全屏', icon: fullScreen ? _jsx(CompressOutlined, {}) : _jsx(ExpandOutlined, {}), onClick: () => setFullScreen(value => !value) }), launchPagePath.current && _jsx(Tooltip, { title: commandId ? '新开页面继续查看当前申请' : '新开页面(未提交内容不会带入)', children: _jsx(Button, { type: "text", "aria-label": "\u65B0\u5F00\u9875\u9762", icon: _jsx(ExportOutlined, {}), href: newPageHref, target: "_blank", rel: "noopener noreferrer", disabled: loading }) }), _jsx(Button, { type: "text", "aria-label": "\u5173\u95ED", disabled: drawerBusy, icon: _jsx(CloseOutlined, {}), onClick: dismissDrawer })] }), children: content }) : variant === 'desktop' ? (_jsx("div", { className: "oxa-workflow-desktop-page oxa-workflow-submission-standalone-page", children: content })) : content;
|
|
1373
|
+
const clearOriginal = (attempt) => {
|
|
1374
|
+
clearPendingWorkflowSubmission(submissionLocatorStorage(), recoveryScope, attempt.idempotencyKey);
|
|
1375
|
+
if (activeRecoveryScope.current === recoveryScope) {
|
|
1376
|
+
setPendingSubmission(null);
|
|
1377
|
+
setRecoveryError(null);
|
|
1378
|
+
setRecoveryObservedAbsent(false);
|
|
1379
|
+
originalRetry.current = null;
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
const resumeOriginal = (id, attempt) => {
|
|
1383
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1384
|
+
return;
|
|
1385
|
+
clearOriginal(attempt);
|
|
1386
|
+
if (onDismiss) {
|
|
1387
|
+
setLocalCommandId(id);
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
const next = new URLSearchParams(searchParams);
|
|
1391
|
+
next.set('processCommandId', id);
|
|
1392
|
+
next.delete('subjectId');
|
|
1393
|
+
setSearchParams(next, { replace: true });
|
|
1394
|
+
};
|
|
1395
|
+
if (pendingSubmission && !commandId) {
|
|
1396
|
+
const checkOriginal = async () => {
|
|
1397
|
+
if (submitInFlight.current)
|
|
1398
|
+
return;
|
|
1399
|
+
submitInFlight.current = true;
|
|
1400
|
+
setLoading(true);
|
|
1401
|
+
setRecoveryError(null);
|
|
1402
|
+
setRecoveryObservedAbsent(false);
|
|
1403
|
+
const controller = new AbortController();
|
|
1404
|
+
const timer = setTimeout(() => controller.abort(), 10000);
|
|
1405
|
+
try {
|
|
1406
|
+
const result = await resolveBusinessProcessOriginal({ operationCode: pendingSubmission.operationCode,
|
|
1407
|
+
workflowCode: pendingSubmission.workflowCode, idempotencyKey: pendingSubmission.idempotencyKey }, controller.signal);
|
|
1408
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1409
|
+
return;
|
|
1410
|
+
if (result.outcome === 'committed')
|
|
1411
|
+
resumeOriginal(result.receipt.commandId, pendingSubmission);
|
|
1412
|
+
else {
|
|
1413
|
+
setRecoveryObservedAbsent(true);
|
|
1414
|
+
setRecoveryError('暂未查到原提交结果。这不代表提交失败,请稍后再查询。');
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
catch (error) {
|
|
1418
|
+
if (activeRecoveryScope.current === recoveryScope)
|
|
1419
|
+
setRecoveryError(errorMessage(error, '原提交结果暂时不可读,请稍后再查询'));
|
|
1420
|
+
}
|
|
1421
|
+
finally {
|
|
1422
|
+
clearTimeout(timer);
|
|
1423
|
+
submitInFlight.current = false;
|
|
1424
|
+
if (activeRecoveryScope.current === recoveryScope)
|
|
1425
|
+
setLoading(false);
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
const retryOriginal = async () => {
|
|
1429
|
+
const replay = originalRetry.current;
|
|
1430
|
+
if (submitInFlight.current || !recoveryObservedAbsent || !replay || replay.context !== currentWriteContext)
|
|
1431
|
+
return;
|
|
1432
|
+
submitInFlight.current = true;
|
|
1433
|
+
setLoading(true);
|
|
1434
|
+
setRecoveryError(null);
|
|
1435
|
+
setRecoveryObservedAbsent(false);
|
|
1436
|
+
try {
|
|
1437
|
+
const command = await replay.send();
|
|
1438
|
+
resumeOriginal(command.id, pendingSubmission);
|
|
1439
|
+
}
|
|
1440
|
+
catch (error) {
|
|
1441
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1442
|
+
return;
|
|
1443
|
+
// A later rejection cannot prove that the earlier unknown request did not commit.
|
|
1444
|
+
setRecoveryError(errorMessage(error, '原提交结果仍未确认,请查询后继续'));
|
|
1445
|
+
}
|
|
1446
|
+
finally {
|
|
1447
|
+
submitInFlight.current = false;
|
|
1448
|
+
if (activeRecoveryScope.current === recoveryScope)
|
|
1449
|
+
setLoading(false);
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
return frame(_jsx(Result, { status: "info", title: loading ? '正在确认提交结果' : '上次提交结果尚未确认', subTitle: recoveryPersisted ? "请先恢复上次提交的结果,避免重复产生申请。刷新页面后可继续查询。" : "请先查询上次提交结果。浏览器未能保存恢复信息,请保留本页和原操作编号。", extra: _jsxs(Space, { direction: "vertical", children: [_jsxs(Typography.Text, { type: "secondary", children: ["\u539F\u64CD\u4F5C\uFF1A", pendingSubmission.idempotencyKey] }), recoveryError && _jsx(Alert, { type: "warning", showIcon: true, title: recoveryError }), _jsxs(Space, { children: [_jsx(Button, { onClick: onDismiss ? dismissDrawer : () => navigate(-1), disabled: loading, children: "\u8FD4\u56DE" }), _jsx(Button, { type: "primary", loading: loading, onClick: () => void checkOriginal(), children: "\u67E5\u8BE2\u63D0\u4EA4\u7ED3\u679C" }), recoveryObservedAbsent && pendingSubmission.kind === 'standard' && originalRetry.current?.context === currentWriteContext
|
|
1453
|
+
&& _jsx(Button, { disabled: loading, onClick: () => void retryOriginal(), children: "\u91CD\u8BD5\u539F\u63D0\u4EA4" })] })] }) }));
|
|
1454
|
+
}
|
|
1355
1455
|
if (!definition)
|
|
1356
1456
|
return frame(_jsx(Result, { status: "404", title: "\u672A\u58F0\u660E\u8BE5\u5DE5\u4F5C\u6D41" }));
|
|
1357
1457
|
if (definition.launch?.mode !== 'standalone' &&
|
|
@@ -1382,8 +1482,23 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1382
1482
|
const submit = async (values) => {
|
|
1383
1483
|
if (submitInFlight.current || commandId || completion || !launchSurface)
|
|
1384
1484
|
return;
|
|
1485
|
+
const unresolved = readPendingWorkflowSubmission(submissionLocatorStorage(), recoveryScope);
|
|
1486
|
+
if (pendingSubmission || unresolved) {
|
|
1487
|
+
if (unresolved)
|
|
1488
|
+
setPendingSubmission(unresolved);
|
|
1489
|
+
return;
|
|
1490
|
+
}
|
|
1385
1491
|
submitInFlight.current = true;
|
|
1386
1492
|
setLoading(true);
|
|
1493
|
+
let dispatched = null;
|
|
1494
|
+
const retainOriginal = (operationCode, kind) => {
|
|
1495
|
+
const attempt = submissionAttempt.current;
|
|
1496
|
+
dispatched = { operationCode, workflowCode, kind, idempotencyKey: attempt.idempotencyKey, requestedAt: attempt.requestedAt };
|
|
1497
|
+
setRecoveryPersisted(writePendingWorkflowSubmission(submissionLocatorStorage(), recoveryScope, dispatched));
|
|
1498
|
+
setPendingSubmission(dispatched);
|
|
1499
|
+
setRecoveryError(null);
|
|
1500
|
+
setRecoveryObservedAbsent(false);
|
|
1501
|
+
};
|
|
1387
1502
|
try {
|
|
1388
1503
|
const encoded = normalizeFormValues(values, subjectDefinition.surface);
|
|
1389
1504
|
const data = Object.fromEntries(fields.filter(field => Object.hasOwn(encoded, field.key)).map(field => [field.key, encoded[field.key]]));
|
|
@@ -1404,19 +1519,21 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1404
1519
|
}
|
|
1405
1520
|
subject = { id: subjectId, revision };
|
|
1406
1521
|
}
|
|
1407
|
-
const
|
|
1408
|
-
values: data,
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}));
|
|
1522
|
+
const namedInput = buildWorkflowNamedOperationInput(namedIntent, {
|
|
1523
|
+
values: data, idempotencyKey: attempt.idempotencyKey, requestedAt: attempt.requestedAt,
|
|
1524
|
+
subjectProfile: identity.subjectProfile, ...(subject ? { subject } : {}),
|
|
1525
|
+
});
|
|
1526
|
+
retainOriginal(namedIntent.operationCode, 'named');
|
|
1527
|
+
const response = await executeWorkflowLaunchNamedOperation(namedIntent, namedInput);
|
|
1414
1528
|
const outcome = parseWorkflowNamedOperationResult(namedIntent, response, {
|
|
1415
1529
|
appCode: launchSurface.appCode,
|
|
1416
1530
|
environmentKey: launchSurface.environmentKey,
|
|
1417
1531
|
workflowCode,
|
|
1418
1532
|
resourceCode: subjectDefinition.code,
|
|
1419
1533
|
});
|
|
1534
|
+
clearOriginal(dispatched);
|
|
1535
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1536
|
+
return;
|
|
1420
1537
|
if (outcome.kind === 'workflow-command') {
|
|
1421
1538
|
if (onDismiss) {
|
|
1422
1539
|
setLocalCommandId(outcome.command.id);
|
|
@@ -1455,12 +1572,14 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1455
1572
|
else {
|
|
1456
1573
|
mutation = { kind: 'create', data };
|
|
1457
1574
|
}
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1575
|
+
const frozenInput = JSON.parse(JSON.stringify({ processOperationCode: definition.processOperationCode,
|
|
1576
|
+
workflowCode, idempotencyKey: attempt.idempotencyKey, mutation }));
|
|
1577
|
+
originalRetry.current = { context: currentWriteContext, send: () => commitStandardProcess(frozenInput) };
|
|
1578
|
+
retainOriginal(definition.processOperationCode, 'standard');
|
|
1579
|
+
const command = await originalRetry.current.send();
|
|
1580
|
+
clearOriginal(dispatched);
|
|
1581
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1582
|
+
return;
|
|
1464
1583
|
if (onDismiss) {
|
|
1465
1584
|
setLocalCommandId(command.id);
|
|
1466
1585
|
return;
|
|
@@ -1471,11 +1590,21 @@ export function WorkflowSubmissionPage({ instancePath, workflowCode: declaredWor
|
|
|
1471
1590
|
setSearchParams(next, { replace: true });
|
|
1472
1591
|
}
|
|
1473
1592
|
catch (error) {
|
|
1474
|
-
|
|
1593
|
+
if (activeRecoveryScope.current !== recoveryScope)
|
|
1594
|
+
return;
|
|
1595
|
+
if (!dispatched || (!namedIntent && standardProcessWasRejected(error))) {
|
|
1596
|
+
if (dispatched)
|
|
1597
|
+
clearOriginal(dispatched);
|
|
1598
|
+
message.error(errorMessage(error, '业务提交被拒绝,请修正后再提交'));
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
setRecoveryError(errorMessage(error, '提交结果尚未确认,请查询原操作'));
|
|
1602
|
+
}
|
|
1475
1603
|
}
|
|
1476
1604
|
finally {
|
|
1477
1605
|
submitInFlight.current = false;
|
|
1478
|
-
|
|
1606
|
+
if (activeRecoveryScope.current === recoveryScope)
|
|
1607
|
+
setLoading(false);
|
|
1479
1608
|
}
|
|
1480
1609
|
};
|
|
1481
1610
|
const answer = async (answers) => {
|