danielzhe commented on code in PR #2508:
URL:
https://github.com/apache/incubator-kie-tools/pull/2508#discussion_r1705475225
##########
packages/dmn-editor/src/mutations/addDecisionToDecisionService.ts:
##########
@@ -25,25 +25,42 @@ import { SnapGrid } from "../store/Store";
import { MIN_NODE_SIZES } from "../diagram/nodes/DefaultSizes";
import { NODE_TYPES } from "../diagram/nodes/NodeTypes";
import { Normalized } from "../normalization/normalize";
+import {
+ DMN15__tBusinessKnowledgeModel,
+ DMN15__tDecision,
+ DMN15__tDecisionService,
+ DMN15__tInputData,
+ DMN15__tKnowledgeSource,
+} from "@kie-tools/dmn-marshaller/src/schemas/dmn-1_5/ts-gen/types";
+
+export type DrgElement =
+ | Normalized<{ __$$element: "decision" } & DMN15__tDecision>
+ | Normalized<{ __$$element: "businessKnowledgeModel" } &
DMN15__tBusinessKnowledgeModel>
+ | Normalized<{ __$$element: "decisionService" } & DMN15__tDecisionService>
+ | Normalized<{ __$$element: "inputData" } & DMN15__tInputData>
+ | Normalized<{ __$$element: "knowledgeSource" } & DMN15__tKnowledgeSource>;
export function addDecisionToDecisionService({
definitions,
- decisionId,
+ drgElement,
decisionServiceId,
drdIndex,
snapGrid,
+ decisionShape,
+ elementId,
}: {
definitions: Normalized<DMN15__tDefinitions>;
- decisionId: string;
+ drgElement: DrgElement;
decisionServiceId: string;
drdIndex: number;
snapGrid: SnapGrid;
+ decisionShape: Normalized<DMNDI15__DMNShape>;
+ elementId: string;
}) {
Review Comment:
I think got your point! I guarantee in the `Diagram.tsx` that the ID
represents a decision, but I am not doing the same inside the mutation, in
other words, the mutation is not "safe" anymore, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]