diff --git a/designer/client/src/components/Process/types.ts b/designer/client/src/components/Process/types.ts index 66e02ce888e..36ddc9dd2e8 100644 --- a/designer/client/src/components/Process/types.ts +++ b/designer/client/src/components/Process/types.ts @@ -47,7 +47,6 @@ export interface Scenario { isFragment: boolean; isLatestVersion: boolean; processCategory: string; - processType: string; modificationDate: Instant; // Deprecated modifiedBy: string; createdAt: Instant; @@ -77,6 +76,7 @@ export type ProcessStateType = { startTime?: Date; attributes?: UnknownRecord; errors?: Array; + version?: number | null; }; export type StatusType = { diff --git a/designer/client/src/reducers/graph/utils.fixtures.ts b/designer/client/src/reducers/graph/utils.fixtures.ts new file mode 100644 index 00000000000..f7b2f01c367 --- /dev/null +++ b/designer/client/src/reducers/graph/utils.fixtures.ts @@ -0,0 +1,775 @@ +import { GraphState } from "./types"; +import { ProcessingMode } from "../../http/HttpService"; +import { EdgeKind } from "../../types"; +import { NodesWithPositions } from "../../actions/nk"; + +export const state: GraphState = { + scenario: { + name: "1819 jira issue example", + processVersionId: 3, + isLatestVersion: true, + isArchived: false, + isFragment: false, + processingType: "request-response-embedded", + processCategory: "RequestResponse", + processingMode: ProcessingMode.requestResponse, + engineSetupName: "Lite Embedded", + modificationDate: "2024-10-03T08:36:52.856496Z", + modifiedAt: "2024-10-03T08:36:52.856496Z", + modifiedBy: "writer", + createdAt: "2024-10-03T08:08:01.927407Z", + createdBy: "writer", + labels: [], + scenarioGraph: { + properties: { + type: "Properties", + additionalFields: { + description: null, + properties: { + inputSchema: "{}", + outputSchema: "{}", + slug: "1819-jira-issue-example", + }, + metaDataType: "RequestResponseMetaData", + showDescription: false, + }, + }, + nodes: [ + { + id: "choice", + expression: null, + exprVal: null, + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 540, + }, + }, + type: "Switch", + }, + { + id: "variable 1", + varName: "varName1", + value: { + language: "spel", + expression: "'value'", + }, + additionalFields: { + description: null, + layoutData: { + x: 0, + y: 720, + }, + }, + type: "Variable", + }, + { + id: "variable 2", + varName: "varName2", + value: { + language: "spel", + expression: "'value'", + }, + additionalFields: { + description: null, + layoutData: { + x: 360, + y: 720, + }, + }, + type: "Variable", + }, + { + id: "union", + outputVar: "outputVar", + nodeType: "union", + parameters: [], + branchParameters: [ + { + branchId: "variable 1", + parameters: [ + { + name: "Output expression", + expression: { + language: "spel", + expression: "1", + }, + }, + ], + }, + { + branchId: "variable 2", + parameters: [ + { + name: "Output expression", + expression: { + language: "spel", + expression: "2", + }, + }, + ], + }, + ], + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 900, + }, + }, + type: "Join", + }, + ], + edges: [ + { + from: "choice", + to: "variable 1", + edgeType: { + condition: { + language: "spel", + expression: "true", + }, + type: EdgeKind.switchNext, + }, + }, + { + from: "variable 1", + to: "union", + edgeType: null, + }, + { + from: "choice", + to: "variable 2", + edgeType: { + condition: { + language: "spel", + expression: "true", + }, + type: EdgeKind.switchNext, + }, + }, + { + from: "variable 2", + to: "union", + edgeType: null, + }, + { + from: "union", + to: "", + edgeType: null, + }, + ], + }, + state: { + externalDeploymentId: null, + status: { + name: "NOT_DEPLOYED", + }, + version: null, + allowedActions: ["DEPLOY", "ARCHIVE", "RENAME"], + icon: "/assets/states/not-deployed.svg", + tooltip: "The scenario is not deployed.", + description: "The scenario is not deployed.", + startTime: null, + attributes: null, + errors: [], + }, + validationResult: { + errors: { + invalidNodes: {}, + processPropertiesErrors: [], + globalErrors: [ + { + error: { + typ: "LooseNode", + message: "Loose node", + description: "Node choice is not connected to source, it cannot be saved properly", + fieldName: null, + errorType: "SaveNotAllowed", + details: null, + }, + nodeIds: ["choice"], + }, + ], + }, + warnings: { + invalidNodes: {}, + }, + nodeResults: { + "variable 3": { + variableTypes: { + outputVar: { + display: "Integer", + type: "TypedClass", + refClazzName: "java.lang.Integer", + params: [], + }, + }, + parameters: null, + typingInfo: { + $expression: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + }, + "$edge-variable 1-union": { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + varName1: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: {}, + }, + request: { + variableTypes: {}, + parameters: [], + typingInfo: {}, + }, + union: { + variableTypes: {}, + parameters: [ + { + name: "Output expression", + typ: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + editor: { + type: "RawParameterEditor", + }, + defaultValue: { + language: "spel", + expression: "", + }, + additionalVariables: {}, + variablesToHide: [], + branchParam: true, + hintText: null, + label: "Output expression", + }, + ], + typingInfo: { + "Output expression-variable 1": { + value: 1, + display: "Integer(1)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + "Output expression-variable 2": { + value: 2, + display: "Integer(2)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + }, + }, + "$edge-variable 2-union": { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + varName2: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: {}, + }, + response: { + variableTypes: { + outputVar: { + display: "List[Integer(1)]", + type: "TypedClass", + refClazzName: "java.util.List", + params: [ + { + value: 1, + display: "Integer(1)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + ], + }, + }, + parameters: [ + { + name: "Raw editor", + typ: { + display: "Boolean", + type: "TypedClass", + refClazzName: "java.lang.Boolean", + params: [], + }, + editor: { + type: "BoolParameterEditor", + }, + defaultValue: { + language: "spel", + expression: "false", + }, + additionalVariables: {}, + variablesToHide: [], + branchParam: false, + hintText: null, + label: "Raw editor", + }, + { + name: "Value", + typ: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + editor: { + type: "RawParameterEditor", + }, + defaultValue: { + language: "spel", + expression: "", + }, + additionalVariables: {}, + variablesToHide: [], + branchParam: false, + hintText: null, + label: "Value", + }, + ], + typingInfo: { + "Raw editor": { + value: false, + display: "Boolean(false)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Boolean", + params: [], + }, + Value: { + display: "Null", + type: "TypedNull", + refClazzName: "java.lang.Object", + params: [], + }, + }, + }, + "variable 1": { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: { + $expression: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + }, + "union 1": { + variableTypes: {}, + parameters: [ + { + name: "Output expression", + typ: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + editor: { + type: "RawParameterEditor", + }, + defaultValue: { + language: "spel", + expression: "", + }, + additionalVariables: {}, + variablesToHide: [], + branchParam: true, + hintText: null, + label: "Output expression", + }, + ], + typingInfo: { + "Output expression-variable 3": { + value: 1, + display: "Integer(1)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + }, + }, + split: { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + }, + parameters: null, + typingInfo: {}, + }, + variable: { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + }, + parameters: null, + typingInfo: { + $expression: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + }, + choice: { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: { + "variable 1": { + value: true, + display: "Boolean(true)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Boolean", + params: [], + }, + "variable 2": { + value: true, + display: "Boolean(true)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Boolean", + params: [], + }, + }, + }, + "$edge-variable 3-union 1": { + variableTypes: { + outputVar: { + display: "Integer", + type: "TypedClass", + refClazzName: "java.lang.Integer", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: {}, + }, + collect: { + variableTypes: { + outputVar: { + value: 1, + display: "Integer(1)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + }, + parameters: [ + { + name: "Input expression", + typ: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + editor: { + type: "RawParameterEditor", + }, + defaultValue: { + language: "spel", + expression: "", + }, + additionalVariables: {}, + variablesToHide: [], + branchParam: false, + hintText: null, + label: "Input expression", + }, + ], + typingInfo: { + "Input expression": { + value: 1, + display: "Integer(1)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.Integer", + params: [], + }, + }, + }, + "variable 2": { + variableTypes: { + input: { + display: "Unknown", + type: "Unknown", + refClazzName: "java.lang.Object", + params: [], + }, + varName: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + parameters: null, + typingInfo: { + $expression: { + value: "value", + display: "String(value)", + type: "TypedObjectWithValue", + refClazzName: "java.lang.String", + params: [], + }, + }, + }, + }, + }, + lastDeployedAction: null, + lastAction: null, + history: [ + { + processVersionId: 3, + createDate: "2024-10-03T08:36:52.856496Z", + user: "writer", + modelVersion: 4, + actions: [], + }, + { + processVersionId: 2, + createDate: "2024-10-03T08:14:04.647992Z", + user: "writer", + modelVersion: 4, + actions: [], + }, + { + processVersionId: 1, + createDate: "2024-10-03T08:08:02.059243Z", + user: "writer", + modelVersion: 4, + actions: [], + }, + ], + }, + unsavedNewName: null, + layout: [ + { + id: "choice", + position: { + x: 180, + y: 540, + }, + }, + { + id: "variable 1", + position: { + x: 0, + y: 720, + }, + }, + { + id: "variable 2", + position: { + x: 360, + y: 720, + }, + }, + { + id: "union", + position: { + x: 180, + y: 900, + }, + }, + ], + selectionState: [], + scenarioLoading: false, + testCapabilities: { + canBeTested: false, + canGenerateTestData: false, + canTestWithForm: false, + }, + testFormParameters: [], + processCounts: {}, + testResults: null, +}; + +export const nodesWithPositions: NodesWithPositions = [ + { + node: { + id: "variable 1", + varName: "varName1", + value: { + language: "spel", + expression: "'value'", + }, + additionalFields: { + description: null, + layoutData: { + x: 0, + y: 720, + }, + }, + type: "Variable", + }, + position: { + x: 350, + y: 859, + }, + }, + { + node: { + id: "variable 2", + varName: "varName2", + value: { + language: "spel", + expression: "'value'", + }, + additionalFields: { + description: null, + layoutData: { + x: 360, + y: 720, + }, + }, + type: "Variable", + }, + position: { + x: 710, + y: 859, + }, + }, + { + node: { + id: "union", + outputVar: "outputVar", + nodeType: "union", + parameters: [], + branchParameters: [ + { + branchId: "variable 1", + parameters: [ + { + name: "Output expression", + expression: { + language: "spel", + expression: "1", + }, + }, + ], + }, + { + branchId: "variable 2", + parameters: [ + { + name: "Output expression", + expression: { + language: "spel", + expression: "2", + }, + }, + ], + }, + ], + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 900, + }, + }, + type: "Join", + }, + position: { + x: 530, + y: 1039, + }, + }, +]; diff --git a/designer/client/src/reducers/graph/utils.test.ts b/designer/client/src/reducers/graph/utils.test.ts new file mode 100644 index 00000000000..fb1e6bdb692 --- /dev/null +++ b/designer/client/src/reducers/graph/utils.test.ts @@ -0,0 +1,222 @@ +import { prepareNewNodesWithLayout } from "./utils"; +import { nodesWithPositions, state } from "./utils.fixtures"; + +describe("GraphUtils prepareNewNodesWithLayout", () => { + it("should update union output expression parameter with an updated node name when new unique node ids created", () => { + const expected = { + layout: [ + { + id: "choice", + position: { + x: 180, + y: 540, + }, + }, + { + id: "variable 1", + position: { + x: 0, + y: 720, + }, + }, + { + id: "variable 2", + position: { + x: 360, + y: 720, + }, + }, + { + id: "union", + position: { + x: 180, + y: 900, + }, + }, + { + id: "variable 1 (copy 1)", + position: { + x: 350, + y: 859, + }, + }, + { + id: "variable 2 (copy 1)", + position: { + x: 710, + y: 859, + }, + }, + { + id: "union (copy 1)", + position: { + x: 530, + y: 1039, + }, + }, + ], + nodes: [ + { + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 540, + }, + }, + exprVal: null, + expression: null, + id: "choice", + type: "Switch", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 0, + y: 720, + }, + }, + id: "variable 1", + type: "Variable", + value: { + expression: "'value'", + language: "spel", + }, + varName: "varName1", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 360, + y: 720, + }, + }, + id: "variable 2", + type: "Variable", + value: { + expression: "'value'", + language: "spel", + }, + varName: "varName2", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 900, + }, + }, + branchParameters: [ + { + branchId: "variable 1", + parameters: [ + { + expression: { + expression: "1", + language: "spel", + }, + name: "Output expression", + }, + ], + }, + { + branchId: "variable 2", + parameters: [ + { + expression: { + expression: "2", + language: "spel", + }, + name: "Output expression", + }, + ], + }, + ], + id: "union", + nodeType: "union", + outputVar: "outputVar", + parameters: [], + type: "Join", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 0, + y: 720, + }, + }, + id: "variable 1 (copy 1)", + type: "Variable", + value: { + expression: "'value'", + language: "spel", + }, + varName: "varName1", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 360, + y: 720, + }, + }, + id: "variable 2 (copy 1)", + type: "Variable", + value: { + expression: "'value'", + language: "spel", + }, + varName: "varName2", + }, + { + additionalFields: { + description: null, + layoutData: { + x: 180, + y: 900, + }, + }, + branchParameters: [ + { + branchId: "variable 1 (copy 1)", + parameters: [ + { + expression: { + expression: "1", + language: "spel", + }, + name: "Output expression", + }, + ], + }, + { + branchId: "variable 2 (copy 1)", + parameters: [ + { + expression: { + expression: "2", + language: "spel", + }, + name: "Output expression", + }, + ], + }, + ], + id: "union (copy 1)", + nodeType: "union", + outputVar: "outputVar", + parameters: [], + type: "Join", + }, + ], + uniqueIds: ["variable 1 (copy 1)", "variable 2 (copy 1)", "union (copy 1)"], + }; + + expect(prepareNewNodesWithLayout(state, nodesWithPositions, true)).toEqual(expected); + }); +}); diff --git a/designer/client/src/reducers/graph/utils.ts b/designer/client/src/reducers/graph/utils.ts index 1bdb63fc12c..ba5f7cb9ea8 100644 --- a/designer/client/src/reducers/graph/utils.ts +++ b/designer/client/src/reducers/graph/utils.ts @@ -3,7 +3,7 @@ import { Layout, NodePosition, NodesWithPositions } from "../../actions/nk"; import ProcessUtils from "../../common/ProcessUtils"; import { ExpressionLang } from "../../components/graph/node-modal/editors/expression/types"; import NodeUtils from "../../components/graph/NodeUtils"; -import { Edge, EdgeType, NodeId, NodeType, ProcessDefinitionData } from "../../types"; +import { BranchParams, Edge, EdgeType, NodeId, NodeType, ProcessDefinitionData } from "../../types"; import { GraphState } from "./types"; export function updateLayoutAfterNodeIdChange(layout: Layout, oldId: NodeId, newId: NodeId): Layout { @@ -57,7 +57,20 @@ export function prepareNewNodesWithLayout( const initialIds = nodesWithPositions.map((nodeWithPosition) => nodeWithPosition.node.id); const uniqueIds = getUniqueIds(initialIds, alreadyUsedIds, isCopy); - const updatedNodes = zipWith(nodesWithPositions, uniqueIds, ({ node }, id) => ({ ...node, id })); + const updatedNodes = zipWith(nodesWithPositions, uniqueIds, ({ node }, id) => { + const nodeCopy = cloneDeep(node); + const adjustBranchParametersToTheCopiedElements = (branchParameter: BranchParams) => { + branchParameter.branchId = uniqueIds.find((uniqueId) => uniqueId.includes(branchParameter.branchId)); + return branchParameter; + }; + + if (nodeCopy.branchParameters) { + nodeCopy.branchParameters = nodeCopy.branchParameters.map(adjustBranchParametersToTheCopiedElements); + } + + nodeCopy.id = id; + return nodeCopy; + }); const updatedLayout = zipWith(nodesWithPositions, uniqueIds, ({ position }, id) => ({ id, position })); return { diff --git a/designer/client/src/types/definition.ts b/designer/client/src/types/definition.ts index 7d287310fcd..09bf83f81b8 100644 --- a/designer/client/src/types/definition.ts +++ b/designer/client/src/types/definition.ts @@ -1,6 +1,7 @@ //types from pl.touk.nussknacker.ui.definition interface TypingResultBase { + value?: string | number | boolean; type: string; display: string; refClazzName: string; diff --git a/designer/client/src/types/node.ts b/designer/client/src/types/node.ts index 3927156f604..6c50031d1f7 100644 --- a/designer/client/src/types/node.ts +++ b/designer/client/src/types/node.ts @@ -47,7 +47,7 @@ export type FragmentNodeType = NodeType; export type Field = Parameter | FragmentInputParameter; export interface Parameter { - uuid: string; + uuid?: string; name: string; expression: Expression; typ?: ReturnedType; diff --git a/designer/client/src/types/validation.ts b/designer/client/src/types/validation.ts index be668a75b8e..a3f9f49ecf9 100644 --- a/designer/client/src/types/validation.ts +++ b/designer/client/src/types/validation.ts @@ -1,8 +1,8 @@ import { TypingInfo, TypingResult, UIParameter } from "./definition"; export type ValidationResult = { - validationErrors: ValidationErrors[]; - validationWarnings: ValidationWarnings[]; + validationErrors?: ValidationErrors[]; + validationWarnings?: ValidationWarnings[]; nodeResults: NodeResults; errors: ValidationErrors; warnings?: Pick; diff --git a/designer/client/test/reducer-test.js b/designer/client/test/reducer-test.js index 01a129b4d0c..cc842d343d5 100644 --- a/designer/client/test/reducer-test.js +++ b/designer/client/test/reducer-test.js @@ -4,7 +4,6 @@ import NodeUtils from "../src/components/graph/NodeUtils"; const baseProcessState = { name: "DEFGH", isLatestVersion: true, - processType: "graph", processCategory: "Category1", modificationDate: "2017-02-14T11:16:56.686", createdAt: "2017-02-14T11:16:56.686", diff --git a/docs/configuration/Common.md b/docs/configuration/Common.md index 8f7c9c3f643..5b15a993121 100644 --- a/docs/configuration/Common.md +++ b/docs/configuration/Common.md @@ -1,6 +1,6 @@ --- -title: Common -sidebar_position: 1 +title: Miscellaneous +sidebar_position: 4 --- # Common diff --git a/docs/configuration/DesignerConfiguration.md b/docs/configuration/DesignerConfiguration.md index 6bac4305857..16489236699 100644 --- a/docs/configuration/DesignerConfiguration.md +++ b/docs/configuration/DesignerConfiguration.md @@ -1,6 +1,6 @@ --- title: Designer -sidebar_position: 4 +sidebar_position: 3 --- # Designer configuration diff --git a/docs/configuration/Overview.mdx b/docs/configuration/Overview.mdx new file mode 100644 index 00000000000..3cfb3a7fbdf --- /dev/null +++ b/docs/configuration/Overview.mdx @@ -0,0 +1,102 @@ +--- +title: Overview +sidebar_position: 1 +--- + +# Overview + +## Minimal configuration file + +The Docker image and the binary distribution contain minimal working [configuration file](https://github.com/TouK/nussknacker/blob/staging/nussknacker-dist/src/universal/conf/application.conf), which is designed as a base for further customizations using +additional configuration files. Check [Conventions section](#conventions) for more details how to amend and override the minimal configuration file. +This file is not used by the [Helm chart](https://artifacthub.io/packages/helm/touk/nussknacker), which prepares its own config file. + +The location and name of the configuration files is defined by the `CONFIG_FILE` environment variable. Consult [Basic environment variables](../configuration/Common.md#basic-environment-variables) for information on how this variable is resolved. + +Details of K8s based configuration can be found in [Nussknacker Helm chart documentation](https://artifacthub.io/packages/helm/touk/nussknacker). +## Configuration areas + +Nussknacker configuration is divided into several configuration areas, each area addressing a specific aspect of using Nussknacker: + +* [Designer](../about/GLOSSARY#nussknacker-designer) configuration (web application ports, security, various UI settings, database), +* Scenario Types configuration, comprising of: + * [Model](./model/ModelConfiguration.md) configuration. + * [Scenario Deployment](./ScenarioDeploymentConfiguration.md) configuration, + * [Category](./DesignerConfiguration.md#scenario-type-categories) configuration + +[Model](../about/GLOSSARY#model) configuration defines which components and which [Processing Mode](../about/ProcessingModes) will be available for the user. +[Scenario Deployment](./ScenarioDeploymentConfiguration.md) configuration defines how scenario using these components will be deployed on the [Engine](../about/engines/Engines.md). +[Category](./DesignerConfiguration.md#scenario-type-categories) defines who has access to the given combination of [Model](../about/GLOSSARY#model) and [Scenario Deployment](./ScenarioDeploymentConfiguration.md). + +The Scenario Type is a convenient umbrella term that groups all these things. Diagram below presents main relationships between configuration areas. + +![Configuration areas](img/configuration_areas.png "configuration areas") + +### Configuration file + +Let's see how those concepts look in fragment of the configuration file: + +
+{/* Somehow, everything which is in the "pre" block is treated as jsx by Docusaurus */}
+{/* so, we need to add opening curly bracket as comment */}
+{/* and add leading spaces in a special way. If not, jsx parser will remove them */}
+{/* Finally, do not worry - this is a valid jsx comment - you will not see it on Nu page*/}
+
+# Designer configuration 
+environment: "local"
+
+{" "}# Each scenario type is configured here 
+{" "}scenarioTypes: {"{"}
+{" "}  "scenario-type-1": {"{"}
+
+{" "}    # Configuration of scenario deployment (Flink used as example here)
+{" "}    deploymentConfig: {"{"} 
+{" "}      type: "flinkStreaming" 
+{" "}      restUrl: "http://localhost:8081" 
+{" "}    } 
+
+{" "}    # Configuration of the model 
+{" "}    modelConfig: {"{"}
+{" "}      classPath: ["model/defaultModel.jar", "model/flinkExecutor.jar", "components/flink"]
+{" "}      restartStrategy.default.strategy: disable
+{" "}      components: {"{"}
+{" "}      }
+{" "}    }
+
+{" "}  category: "Default"
+{" "}  }
+{" "}}
+
+ +It is worth noting that one Nussknacker Designer may be used to work with multiple Scenario Types and allow user: + +* To use different set of components depending on the category +* To deploy scenarios on different [Engines](../about/engines/Engines.md) + +See [development configuration](https://github.com/TouK/nussknacker/blob/staging/nussknacker-dist/src/universal/conf/dev-application.conf#L33) (used to test various Nussknacker features) for an example of configuration with more than one Scenario Type. + +## Conventions + +* We use HOCON (see the [introduction](https://github.com/lightbend/config#using-hocon-the-json-superset) or + the [full specification](https://github.com/lightbend/config/blob/master/HOCON.md) for details) as our main + configuration format. [Lightbend config library](https://github.com/lightbend/config/tree/master) is used for + parsing configuration files - you can check the [documentation](https://github.com/lightbend/config#standard-behavior) + for details on conventions of file names and merging of configuration files. +* `nussknacker.config.locations` Java system property (`CONFIG_FILE` environment variable for Docker image) defines + location of configuration files (separated by comma). The files are read in order, entries from later files can + override the former (using HOCON fallback mechanism). This mechanism is used to extend or override default + configuration contained in the [minimal configuration file](#minimal-configuration-file) - see docker demo + for example: + * [setting multiple configuration files](https://github.com/TouK/nussknacker-installation-example/blob/master/docker-compose.yml#L29) + * [file with configuration override](https://github.com/TouK/nussknacker-installation-example/blob/master/designer/application-customizations.conf) +* If `config.override_with_env_vars` Java system property is set to true, it is possible to override settings with env + variables. This property is set to true in the official Nussknacker Docker image. + +It’s important to remember that model configuration is prepared a bit differently. Please read +[model configuration](./model/ModelConfiguration.md) for the details. + +## What is next? +Most likely you will want to configure enrichers - they are configured under the `modelConfig.components` configuration +key - see the [configuration file](#configuration-file). The details of enrichers configuration are in +the [Integration chapter](../integration/index.mdx) of the documentation. + diff --git a/docs/configuration/ScenarioDeploymentConfiguration.md b/docs/configuration/ScenarioDeploymentConfiguration.md index ced8bd92cf0..9e172b9bf85 100644 --- a/docs/configuration/ScenarioDeploymentConfiguration.md +++ b/docs/configuration/ScenarioDeploymentConfiguration.md @@ -1,6 +1,6 @@ --- title: Deployment -sidebar_position: 3 +sidebar_position: 2 --- # Scenario Deployment configuration diff --git a/docs/configuration/index.mdx b/docs/configuration/index.mdx index f0409915dc0..78641fcbdf9 100644 --- a/docs/configuration/index.mdx +++ b/docs/configuration/index.mdx @@ -2,103 +2,6 @@ title: Configuration --- -# Overview - -## Minimal configuration file - -The Docker image and the binary distribution contain minimal working [configuration file](https://github.com/TouK/nussknacker/blob/staging/nussknacker-dist/src/universal/conf/application.conf), which is designed as a base for further customizations using -additional configuration files. Check [Conventions section](#conventions) for more details how to amend and override the minimal configuration file. -This file is not used by the [Helm chart](https://artifacthub.io/packages/helm/touk/nussknacker), which prepares its own config file. - -The location and name of the configuration files is defined by the `CONFIG_FILE` environment variable. Consult [Basic environment variables](../configuration/Common.md#basic-environment-variables) for information on how this variable is resolved. - -Details of K8s based configuration can be found in [Nussknacker Helm chart documentation](https://artifacthub.io/packages/helm/touk/nussknacker). -## Configuration areas - -Nussknacker configuration is divided into several configuration areas, each area addressing a specific aspect of using Nussknacker: - -* [Designer](../about/GLOSSARY#nussknacker-designer) configuration (web application ports, security, various UI settings, database), -* Scenario Types configuration, comprising of: - * [Model](./model/ModelConfiguration.md) configuration. - * [Scenario Deployment](./ScenarioDeploymentConfiguration.md) configuration, - * [Category](./DesignerConfiguration.md#scenario-type-categories) configuration - -[Model](../about/GLOSSARY#model) configuration defines which components and which [Processing Mode](../about/ProcessingModes) will be available for the user. -[Scenario Deployment](./ScenarioDeploymentConfiguration.md) configuration defines how scenario using these components will be deployed on the [Engine](../about/engines/Engines.md). -[Category](./DesignerConfiguration.md#scenario-type-categories) defines who has access to the given combination of [Model](../about/GLOSSARY#model) and [Scenario Deployment](./ScenarioDeploymentConfiguration.md). - -The Scenario Type is a convenient umbrella term that groups all these things. Diagram below presents main relationships between configuration areas. - -![Configuration areas](img/configuration_areas.png "configuration areas") - -### Configuration file - -Let's see how those concepts look in fragment of the configuration file: - -
-{/* Somehow, everything which is in the "pre" block is treated as jsx by Docusaurus*/}
-{/* so, we need to escape "{" */}
-{/* and add leading spaces in a special way. If not jsx parser will remove them */}
-{/* Finally, do not worry - this is a valid jsx comment - you will not see it on Nu page*/}
-
-# Designer configuration  
-environment: "local"
-...
-
-# Each scenario type is configured here
-{" "} scenarioTypes: {"{"}
-{" "} "scenario-type-1": {"{"}
-{" "} # Configuration of scenario deployment (Flink used as example here)
-{" "} deploymentConfig: {"{"}
-{" "} type: "flinkStreaming"
-{" "} restUrl: "http://localhost:8081"
-{" "} }
-{" "} # Configuration of the model
-{" "} modelConfig: {"{"}
-{" "} classPath: ["model/defaultModel.jar", "model/flinkExecutor.jar", "components/flink"]
-{" "} restartStrategy.default.strategy: disable
-{" "} components {"{"}
-{" "} ...
-{" "} }
-{" "} }
-{" "} category: "Default"
-{" "} }
-}
-
- -It is worth noting that one Nussknacker Designer may be used to work with multiple Scenario Types and allow user: - -* To use different set of components depending on the category -* To deploy scenarios on different [Engines](../about/engines/Engines.md) - -See [development configuration](https://github.com/TouK/nussknacker/blob/staging/nussknacker-dist/src/universal/conf/dev-application.conf#L33) (used to test various Nussknacker features) for an example of configuration with more than one Scenario Type. - -## Conventions - -* We use HOCON (see the [introduction](https://github.com/lightbend/config#using-hocon-the-json-superset) or - the [full specification](https://github.com/lightbend/config/blob/master/HOCON.md) for details) as our main - configuration format. [Lightbend config library](https://github.com/lightbend/config/tree/master) is used for - parsing configuration files - you can check the [documentation](https://github.com/lightbend/config#standard-behavior) - for details on conventions of file names and merging of configuration files. -* `nussknacker.config.locations` Java system property (`CONFIG_FILE` environment variable for Docker image) defines - location of configuration files (separated by comma). The files are read in order, entries from later files can - override the former (using HOCON fallback mechanism). This mechanism is used to extend or override default - configuration contained in the [minimal configuration file](#minimal-configuration-file) - see docker demo - for example: - * [setting multiple configuration files](https://github.com/TouK/nussknacker-installation-example/blob/master/docker-compose.yml#L29) - * [file with configuration override](https://github.com/TouK/nussknacker-installation-example/blob/master/designer/application-customizations.conf) -* If `config.override_with_env_vars` Java system property is set to true, it is possible to override settings with env - variables. This property is set to true in the official Nussknacker Docker image. - -It’s important to remember that model configuration is prepared a bit differently. Please read -[model configuration](./model/ModelConfiguration.md) for the details. - -## What is next? -Most likely you will want to configure enrichers - they are configured under the `modelConfig.components` configuration -key - see the [configuration file](#configuration-file). The details of enrichers configuration are in -the [Integration chapter](../integration/index.mdx) of the documentation. - - import DocCardList from '@theme/DocCardList';