diff --git a/components-api/src/main/scala/pl/touk/nussknacker/engine/api/process/Source.scala b/components-api/src/main/scala/pl/touk/nussknacker/engine/api/process/Source.scala index 0a213e5bc6b..bbde1b736a6 100644 --- a/components-api/src/main/scala/pl/touk/nussknacker/engine/api/process/Source.scala +++ b/components-api/src/main/scala/pl/touk/nussknacker/engine/api/process/Source.scala @@ -54,8 +54,8 @@ trait TestWithParametersSupport[+T] { self: Source => * e.g. * {"DEPLOY": { "parametername": ...parameter configuration... } */ -trait WithActivityParameters { self: Source => - def activityParametersDefinition: Map[String, Map[String, ParameterConfig]] +trait WithActionParameters { self: Source => + def actionParametersDefinition: Map[String, Map[String, ParameterConfig]] } /** diff --git a/designer/client/src/actions/actionTypes.ts b/designer/client/src/actions/actionTypes.ts index c0571599610..33d6967c3b3 100644 --- a/designer/client/src/actions/actionTypes.ts +++ b/designer/client/src/actions/actionTypes.ts @@ -21,7 +21,7 @@ export type ActionTypes = | "PROCESS_RENAME" | "EDIT_LABELS" | "SHOW_METRICS" - | "UPDATE_ACTIVITY_PARAMETERS" + | "UPDATE_ACTION_PARAMETERS" | "UPDATE_TEST_CAPABILITIES" | "UPDATE_TEST_FORM_PARAMETERS" | "DISPLAY_PROCESS" diff --git a/designer/client/src/actions/nk/process.ts b/designer/client/src/actions/nk/process.ts index b3e575917d9..c4bee43604d 100644 --- a/designer/client/src/actions/nk/process.ts +++ b/designer/client/src/actions/nk/process.ts @@ -36,12 +36,12 @@ export function loadProcessState(processName: ProcessName, processVersionId: num ); } -export function fetchActivityParameters(processName: ProcessName, scenarioGraph: ScenarioGraph) { +export function fetchActionParameters(processName: ProcessName, scenarioGraph: ScenarioGraph) { return (dispatch) => - HttpService.getActivityParameters(processName, scenarioGraph).then(({ data }) => { + HttpService.getActionParameters(processName, scenarioGraph).then(({ data }) => { dispatch({ - type: "UPDATE_ACTIVITY_PARAMETERS", - activityParameters: data, + type: "UPDATE_ACTION_PARAMETERS", + actionParameters: data, }); }); } diff --git a/designer/client/src/components/modals/ActivityProperty.tsx b/designer/client/src/components/modals/ActionParameter.tsx similarity index 81% rename from designer/client/src/components/modals/ActivityProperty.tsx rename to designer/client/src/components/modals/ActionParameter.tsx index c401d025e16..42842479fc8 100644 --- a/designer/client/src/components/modals/ActivityProperty.tsx +++ b/designer/client/src/components/modals/ActionParameter.tsx @@ -2,7 +2,7 @@ import { ExpressionLang } from "../graph/node-modal/editors/expression/types"; import React, { useCallback } from "react"; import { FieldLabel } from "../graph/node-modal/FieldLabel"; import { getValidationErrorsForField } from "../graph/node-modal/editors/Validators"; -import { ActivityNodeParameters, ActivityParameterConfig } from "../../types/activity"; +import { ActionNodeParameters, ActionParameterConfig } from "../../types/action"; import { NodesDeploymentData } from "../../http/HttpService"; import { NodeValidationError } from "../../types"; import { default as EditableEditor } from "../graph/node-modal/editors/EditableEditor"; @@ -10,18 +10,18 @@ import { default as EditableEditor } from "../graph/node-modal/editors/EditableE interface Props { nodeName: string; propertyName: string; - propertyConfig: ActivityParameterConfig; + propertyConfig: ActionParameterConfig; nodesData: NodesDeploymentData; - onChange: ( + onChange: ( nodeId: string, property: K, - newValue: ActivityNodeParameters["parameters"][K], - defaultValue?: ActivityNodeParameters["parameters"][K], + newValue: ActionNodeParameters["parameters"][K], + defaultValue?: ActionNodeParameters["parameters"][K], ) => void; errors: NodeValidationError[]; } -export function ActivityProperty(props: Props): JSX.Element { +export function ActionParameter(props: Props): JSX.Element { const { nodeName, propertyName, propertyConfig, errors, nodesData, onChange } = props; const current = nodesData[nodeName][propertyName] || ""; diff --git a/designer/client/src/components/modals/DeployWithParametersDialog.tsx b/designer/client/src/components/modals/DeployWithParametersDialog.tsx index 717e7c1ba7c..cb9270582b4 100644 --- a/designer/client/src/components/modals/DeployWithParametersDialog.tsx +++ b/designer/client/src/components/modals/DeployWithParametersDialog.tsx @@ -3,7 +3,7 @@ import { WindowButtonProps, WindowContentProps } from "@touk/window-manager"; import React, { useCallback, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { useDispatch, useSelector } from "react-redux"; -import { getActivityParameters, getProcessName } from "../../reducers/selectors/graph"; +import { getActionParameters, getProcessName } from "../../reducers/selectors/graph"; import { getFeatureSettings } from "../../reducers/selectors/settings"; import { ProcessName } from "../Process/types"; import { PromptContent, WindowKind } from "../../windowManager"; @@ -11,11 +11,11 @@ import CommentInput from "../comment/CommentInput"; import ProcessDialogWarnings from "./ProcessDialogWarnings"; import { FormHelperText, Typography } from "@mui/material"; import { LoadingButtonTypes } from "../../windowManager/LoadingButton"; -import { ActivityNodeParameters } from "../../types/activity"; +import { ActionNodeParameters } from "../../types/action"; import { AdvancedParametersSection } from "./AdvancedParametersSection"; import { mapValues } from "lodash"; import { NodesDeploymentData } from "../../http/HttpService"; -import { ActivityProperty } from "./ActivityProperty"; +import { ActionParameter } from "./ActionParameter"; import { NodeTable } from "../graph/node-modal/NodeDetailsContent/NodeTable"; export type ToggleProcessActionModalData = { @@ -23,7 +23,7 @@ export type ToggleProcessActionModalData = { displayWarnings?: boolean; }; -function initialNodesData(params: ActivityNodeParameters[]) { +function initialNodesData(params: ActionNodeParameters[]) { return params.reduce( (paramObj, { nodeId, parameters }) => ({ ...paramObj, @@ -40,8 +40,8 @@ export function DeployWithParametersDialog(props: WindowContentProps initialNodesData(activityNodeParameters), [activityNodeParameters]); const [values, setValues] = useState(initialValues); @@ -90,12 +90,12 @@ export function DeployWithParametersDialog(props: WindowContentProps {validationError} - {activityNodeParameters.map((anp: ActivityNodeParameters) => ( + {activityNodeParameters.map((anp: ActionNodeParameters) => ( {Object.entries(anp.parameters).map(([paramName, paramConfig]) => { return ( - { - dispatch(fetchActivityParameters(scenarioName, scenarioGraph)); + dispatch(fetchActionParameters(scenarioName, scenarioGraph)); }, [dispatch, scenarioName, scenarioGraph]); } diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx index a12b8cf69bf..659c8130d6f 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx @@ -13,7 +13,7 @@ import { ToolbarButton } from "../../../toolbarComponents/toolbarButtons"; import { ToolbarButtonProps } from "../../types"; import { ACTION_DIALOG_WIDTH } from "../../../../stylesheets/variables"; -import { useActivityCapabilities } from "../../../modals/GenericAction/useActivityCapabilities"; +import { useActionCapabilities } from "../../../modals/GenericAction/useActionCapabilities"; export default function DeployButton(props: ToolbarButtonProps) { const dispatch = useDispatch(); @@ -26,7 +26,7 @@ export default function DeployButton(props: ToolbarButtonProps) { const { disabled, type } = props; // TODO: find better place to reload activity capabilities and properties - useActivityCapabilities(); + useActionCapabilities(); const available = !disabled && deployPossible && capabilities.deploy; diff --git a/designer/client/src/http/HttpService.ts b/designer/client/src/http/HttpService.ts index 5a06831a07e..19fbab4a389 100644 --- a/designer/client/src/http/HttpService.ts +++ b/designer/client/src/http/HttpService.ts @@ -666,14 +666,14 @@ class HttpService { return promise; } - getActivityParameters(processName: string, scenarioGraph: ScenarioGraph) { + getActionParameters(processName: string, scenarioGraph: ScenarioGraph) { const promise = api.post( - `/activityInfo/${encodeURIComponent(processName)}/activityParameters`, + `/actionInfo/${encodeURIComponent(processName)}/actionParameters`, this.#sanitizeScenarioGraph(scenarioGraph), ); promise.catch((error) => this.#addError( - i18next.t("notification.error.failedToGetTestParameters", "Failed to get activity parameters definition"), + i18next.t("notification.error.failedToGetActionParameters", "Failed to get action parameters definition"), error, true, ), diff --git a/designer/client/src/reducers/graph/reducer.ts b/designer/client/src/reducers/graph/reducer.ts index bc69852ebba..f5715a8ddc0 100644 --- a/designer/client/src/reducers/graph/reducer.ts +++ b/designer/client/src/reducers/graph/reducer.ts @@ -84,10 +84,10 @@ const graphReducer: Reducer = (state = emptyGraphState, action) => { testFormParameters: action.testFormParameters, }; } - case "UPDATE_ACTIVITY_PARAMETERS": { + case "UPDATE_ACTION_PARAMETERS": { return { ...state, - activityParameters: action.activityParameters, + actionParameters: action.actionParameters, }; } case "DISPLAY_PROCESS": { diff --git a/designer/client/src/reducers/graph/types.ts b/designer/client/src/reducers/graph/types.ts index 5e16836f8c0..a13021ad863 100644 --- a/designer/client/src/reducers/graph/types.ts +++ b/designer/client/src/reducers/graph/types.ts @@ -1,7 +1,7 @@ import { Layout, RefreshData } from "../../actions/nk"; import { Scenario } from "../../components/Process/types"; import { TestCapabilities, TestFormParameters, TestResults } from "../../common/TestResultUtils"; -import { ActivityParameters } from "../../types/activity"; +import { ActionParameters } from "../../types/action"; export interface NodeCounts { errors?: number; @@ -16,7 +16,7 @@ export type GraphState = { scenario?: Scenario; selectionState?: string[]; layout: Layout; - activityParameters?: ActivityParameters; + actionParameters?: ActionParameters; testCapabilities?: TestCapabilities; testFormParameters?: TestFormParameters[]; testResults: TestResults; diff --git a/designer/client/src/reducers/selectors/graph.ts b/designer/client/src/reducers/selectors/graph.ts index 8a3b2cdd428..11b367c6173 100644 --- a/designer/client/src/reducers/selectors/graph.ts +++ b/designer/client/src/reducers/selectors/graph.ts @@ -8,7 +8,7 @@ import { ProcessCounts } from "../graph"; import { RootState } from "../index"; import { getProcessState } from "./scenarioState"; import { TestFormParameters } from "../../common/TestResultUtils"; -import { ActivityParameters } from "../../types/activity"; +import { ActionParameters } from "../../types/action"; export const getGraph = (state: RootState) => state.graphReducer.history.present; @@ -71,7 +71,7 @@ export const isArchivePossible = createSelector( [getProcessState, isFragment], (state, isFragment) => isFragment || ProcessStateUtils.canArchive(state), ); -export const getActivityParameters = createSelector(getGraph, (g) => g.activityParameters || ({} as ActivityParameters)); +export const getActionParameters = createSelector(getGraph, (g) => g.actionParameters || ({} as ActionParameters)); export const getTestCapabilities = createSelector(getGraph, (g) => g.testCapabilities); export const getTestParameters = createSelector(getGraph, (g) => g.testFormParameters || ([] as TestFormParameters[])); export const getTestResults = createSelector(getGraph, (g) => g.testResults); diff --git a/designer/client/src/types/action.ts b/designer/client/src/types/action.ts new file mode 100644 index 00000000000..cbba810bbad --- /dev/null +++ b/designer/client/src/types/action.ts @@ -0,0 +1,18 @@ +import { NodeId } from "./node"; +import { ActionName } from "../components/Process/types"; + +export interface ActionParameterConfig { + editor: any; + label: string; + defaultValue: string | null; + hintText: string | null; +} + +export type ActionParameterName = string; + +export interface ActionNodeParameters { + nodeId: NodeId; + parameters: { [key: ActionParameterName]: ActionParameterConfig }; +} + +export type ActionParameters = { [key: ActionName]: ActionNodeParameters[] }; diff --git a/designer/client/src/types/activity.ts b/designer/client/src/types/activity.ts deleted file mode 100644 index 636b095b786..00000000000 --- a/designer/client/src/types/activity.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NodeId } from "./node"; - -export interface ActivityParameterConfig { - editor: any; - label: string; - defaultValue: string | null; - hintText: string | null; -} - -export type ActivityParameterName = string; - -export interface ActivityNodeParameters { - nodeId: NodeId; - parameters: { [key: ActivityParameterName]: ActivityParameterConfig }; -} - -export type ActivityName = string; - -export type ActivityParameters = { [key: ActivityName]: ActivityNodeParameters[] }; diff --git a/designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/definition/package.scala b/designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/definition/package.scala index 355af037c87..03c0f6cb851 100644 --- a/designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/definition/package.scala +++ b/designer/restmodel/src/main/scala/pl/touk/nussknacker/restmodel/definition/package.scala @@ -133,7 +133,7 @@ package object definition { hintText: Option[String] ) - @JsonCodec final case class UiActivityParameterConfig( + @JsonCodec final case class UiActionParameterConfig( defaultValue: Option[String], editor: ParameterEditor, label: Option[String], diff --git a/designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActivityInfoResources.scala b/designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActionInfoResources.scala similarity index 78% rename from designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActivityInfoResources.scala rename to designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActionInfoResources.scala index aee3cec6b4d..3928872ac1a 100644 --- a/designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActivityInfoResources.scala +++ b/designer/server/src/main/scala/pl/touk/nussknacker/ui/api/ActionInfoResources.scala @@ -6,15 +6,15 @@ import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport import pl.touk.nussknacker.engine.api.graph.ScenarioGraph import pl.touk.nussknacker.ui.api.utils.ScenarioDetailsOps.ScenarioWithDetailsOps import pl.touk.nussknacker.ui.process.ProcessService -import pl.touk.nussknacker.ui.process.newactivity.ActivityInfoService +import pl.touk.nussknacker.ui.process.newactivity.ActionInfoService import pl.touk.nussknacker.ui.process.processingtype.provider.ProcessingTypeDataProvider import pl.touk.nussknacker.ui.security.api.LoggedUser import scala.concurrent.ExecutionContext -class ActivityInfoResources( +class ActionInfoResources( protected val processService: ProcessService, - activityInfoService: ProcessingTypeDataProvider[ActivityInfoService, _] + actionInfoService: ProcessingTypeDataProvider[ActionInfoService, _] )(implicit val ec: ExecutionContext) extends Directives with FailFastCirceSupport @@ -23,14 +23,14 @@ class ActivityInfoResources( with LazyLogging { def securedRoute(implicit user: LoggedUser): Route = { - pathPrefix("activityInfo" / ProcessNameSegment) { processName => + pathPrefix("actionInfo" / ProcessNameSegment) { processName => (post & processDetailsForName(processName)) { processDetails => entity(as[ScenarioGraph]) { scenarioGraph => - path("activityParameters") { + path("actionParameters") { complete { - activityInfoService + actionInfoService .forProcessingTypeUnsafe(processDetails.processingType) - .getActivityParameters( + .getActionParameters( scenarioGraph, processDetails.processVersionUnsafe, processDetails.isFragment diff --git a/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActivityInfoService.scala b/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActionInfoService.scala similarity index 64% rename from designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActivityInfoService.scala rename to designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActionInfoService.scala index 74d59891cd9..097778776fc 100644 --- a/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActivityInfoService.scala +++ b/designer/server/src/main/scala/pl/touk/nussknacker/ui/process/newactivity/ActionInfoService.scala @@ -6,31 +6,30 @@ import pl.touk.nussknacker.engine.api.ProcessVersion import pl.touk.nussknacker.engine.api.definition.RawParameterEditor import pl.touk.nussknacker.engine.api.graph.ScenarioGraph import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess -import pl.touk.nussknacker.engine.definition.activity.ActivityInfoProvider -import pl.touk.nussknacker.restmodel.definition.UiActivityParameterConfig -import pl.touk.nussknacker.ui.process.newactivity.ActivityInfoService.{ActivityName, UiActivityNodeParameters} +import pl.touk.nussknacker.engine.definition.activity.ActionInfoProvider +import pl.touk.nussknacker.restmodel.definition.UiActionParameterConfig +import pl.touk.nussknacker.ui.process.newactivity.ActionInfoService.{ActivityName, UiActionNodeParameters} import pl.touk.nussknacker.ui.security.api.LoggedUser import pl.touk.nussknacker.ui.uiresolving.UIProcessResolver -// TODO: move to ActivityService? execute node compilation only once with ScenarioTestService? -class ActivityInfoService(activityInfoProvider: ActivityInfoProvider, processResolver: UIProcessResolver) { +class ActionInfoService(activityInfoProvider: ActionInfoProvider, processResolver: UIProcessResolver) { - def getActivityParameters( + def getActionParameters( scenarioGraph: ScenarioGraph, processVersion: ProcessVersion, isFragment: Boolean )( implicit user: LoggedUser - ): Map[ActivityName, List[UiActivityNodeParameters]] = { + ): Map[ActivityName, List[UiActionNodeParameters]] = { val canonical = toCanonicalProcess(scenarioGraph, processVersion, isFragment) activityInfoProvider - .getActivityParameters(processVersion, canonical) + .getActionParameters(processVersion, canonical) .map { case (activityName, nodeParamsMap) => activityName -> nodeParamsMap.map { case (nodeId, params) => - UiActivityNodeParameters( + UiActionNodeParameters( NodeId(nodeId), params.map { case (name, value) => - name -> UiActivityParameterConfig( + name -> UiActionParameterConfig( value.defaultValue, value.editor.getOrElse(RawParameterEditor), value.label, @@ -53,7 +52,7 @@ class ActivityInfoService(activityInfoProvider: ActivityInfoProvider, processRes } -object ActivityInfoService { +object ActionInfoService { type ActivityName = String - @JsonCodec case class UiActivityNodeParameters(nodeId: NodeId, parameters: Map[String, UiActivityParameterConfig]) + @JsonCodec case class UiActionNodeParameters(nodeId: NodeId, parameters: Map[String, UiActionParameterConfig]) } diff --git a/designer/server/src/main/scala/pl/touk/nussknacker/ui/server/AkkaHttpBasedRouteProvider.scala b/designer/server/src/main/scala/pl/touk/nussknacker/ui/server/AkkaHttpBasedRouteProvider.scala index d96b18c8fa3..b2414f14ba0 100644 --- a/designer/server/src/main/scala/pl/touk/nussknacker/ui/server/AkkaHttpBasedRouteProvider.scala +++ b/designer/server/src/main/scala/pl/touk/nussknacker/ui/server/AkkaHttpBasedRouteProvider.scala @@ -59,7 +59,7 @@ import pl.touk.nussknacker.ui.process.deployment.{ import pl.touk.nussknacker.ui.process.fragment.{DefaultFragmentRepository, FragmentResolver} import pl.touk.nussknacker.ui.process.label.ScenarioLabelsService import pl.touk.nussknacker.ui.process.migrate.{HttpRemoteEnvironment, ProcessModelMigrator, TestModelMigrations} -import pl.touk.nussknacker.ui.process.newactivity.{ActivityInfoService, ActivityService} +import pl.touk.nussknacker.ui.process.newactivity.{ActionInfoService, ActivityService} import pl.touk.nussknacker.ui.process.newdeployment.synchronize.{ DeploymentsStatusesSynchronizationConfig, DeploymentsStatusesSynchronizationScheduler, @@ -218,7 +218,7 @@ class AkkaHttpBasedRouteProvider( ) } val scenarioActivityService = scenarioTestServiceDeps.mapValues { case (_, processResolver, _, modelData, _) => - new ActivityInfoService( + new ActionInfoService( new ModelDataActivityInfoProvider(modelData), processResolver ) @@ -513,7 +513,7 @@ class AkkaHttpBasedRouteProvider( ) } ), - new ActivityInfoResources(processService, scenarioActivityService), + new ActionInfoResources(processService, scenarioActivityService), new StatusResources(stateDefinitionService), ) diff --git a/engine/flink/kafka-components-utils/src/main/scala/pl/touk/nussknacker/engine/kafka/source/flink/FlinkKafkaSource.scala b/engine/flink/kafka-components-utils/src/main/scala/pl/touk/nussknacker/engine/kafka/source/flink/FlinkKafkaSource.scala index 98186aee4bd..ae59bc21d5d 100644 --- a/engine/flink/kafka-components-utils/src/main/scala/pl/touk/nussknacker/engine/kafka/source/flink/FlinkKafkaSource.scala +++ b/engine/flink/kafka-components-utils/src/main/scala/pl/touk/nussknacker/engine/kafka/source/flink/FlinkKafkaSource.scala @@ -19,7 +19,7 @@ import pl.touk.nussknacker.engine.api.process.{ ContextInitializer, TestWithParametersSupport, TopicName, - WithActivityParameters + WithActionParameters } import pl.touk.nussknacker.engine.api.runtimecontext.{ContextIdGenerator, EngineRuntimeContext} import pl.touk.nussknacker.engine.api.test.{TestRecord, TestRecordParser} @@ -66,7 +66,7 @@ class FlinkKafkaSource[T]( with FlinkSourceTestSupport[T] with RecordFormatterBaseTestDataGenerator with TestWithParametersSupport[T] - with WithActivityParameters + with WithActionParameters with LazyLogging { @silent("deprecated") @@ -88,7 +88,7 @@ class FlinkKafkaSource[T]( private val defaultOffsetResetStrategy = if (kafkaConfig.forceLatestRead.contains(true)) OffsetResetStrategy.Reset else OffsetResetStrategy.Continue - override def activityParametersDefinition: Map[String, Map[String, ParameterConfig]] = { + override def actionParametersDefinition: Map[String, Map[String, ParameterConfig]] = { Map( ScenarioActionName.Deploy.value -> Map( OFFSET_RESET_STRATEGY_PARAM_NAME -> ParameterConfig( diff --git a/engine/flink/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/flink/KafkaSourceWithDeploymentParametersSpec.scala b/engine/flink/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/flink/KafkaSourceWithDeploymentParametersSpec.scala index d9cd46645d2..0cc2c91c059 100644 --- a/engine/flink/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/flink/KafkaSourceWithDeploymentParametersSpec.scala +++ b/engine/flink/kafka-components-utils/src/test/scala/pl/touk/nussknacker/engine/kafka/source/flink/KafkaSourceWithDeploymentParametersSpec.scala @@ -7,7 +7,6 @@ import pl.touk.nussknacker.engine.kafka.source.flink.FlinkKafkaSource.OffsetRese import pl.touk.nussknacker.engine.kafka.source.flink.FlinkKafkaSource.OffsetResetStrategy.OffsetResetStrategy import pl.touk.nussknacker.engine.kafka.source.flink.KafkaSourceFactoryMixin.{ObjToSerialize, SampleKey, SampleValue} import pl.touk.nussknacker.engine.kafka.source.flink.KafkaSourceFactoryProcessConfigCreator.ResultsHolders -import pl.touk.nussknacker.engine.process.runner.UnitTestsFlinkRunner class KafkaSourceWithDeploymentParametersSpec extends KafkaSourceFactoryProcessMixin { diff --git a/engine/flink/management/dev-model/src/main/scala/pl/touk/nussknacker/engine/management/sample/source/BoundedSource.scala b/engine/flink/management/dev-model/src/main/scala/pl/touk/nussknacker/engine/management/sample/source/BoundedSource.scala index a20249046c7..e9f268dfe5b 100644 --- a/engine/flink/management/dev-model/src/main/scala/pl/touk/nussknacker/engine/management/sample/source/BoundedSource.scala +++ b/engine/flink/management/dev-model/src/main/scala/pl/touk/nussknacker/engine/management/sample/source/BoundedSource.scala @@ -6,7 +6,7 @@ import pl.touk.nussknacker.engine.api.component.{ParameterConfig, UnboundedStrea import pl.touk.nussknacker.engine.api.definition.{FixedExpressionValue, FixedValuesParameterEditor, RawParameterEditor} import pl.touk.nussknacker.engine.api.deployment.ScenarioActionName import pl.touk.nussknacker.engine.api.editor.FixedValuesEditorMode -import pl.touk.nussknacker.engine.api.process.{SourceFactory, WithActivityParameters} +import pl.touk.nussknacker.engine.api.process.{SourceFactory, WithActionParameters} import pl.touk.nussknacker.engine.api.typed.typing.Unknown import pl.touk.nussknacker.engine.api.{MethodToInvoke, ParamName} import pl.touk.nussknacker.engine.flink.api.process.FlinkCustomNodeContext @@ -29,9 +29,9 @@ object BoundedSourceWithOffset extends SourceFactory with UnboundedStreamCompone @MethodToInvoke def source(@ParamName("elements") elements: java.util.List[Any]) = - new CollectionSource[Any](elements.asScala.toList, None, Unknown) with WithActivityParameters { + new CollectionSource[Any](elements.asScala.toList, None, Unknown) with WithActionParameters { - override def activityParametersDefinition: Map[String, Map[String, ParameterConfig]] = { + override def actionParametersDefinition: Map[String, Map[String, ParameterConfig]] = { Map( ScenarioActionName.Deploy.value -> deployActivityParameters ) diff --git a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActivityInfoProvider.scala b/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActionInfoProvider.scala similarity index 58% rename from scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActivityInfoProvider.scala rename to scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActionInfoProvider.scala index 090d9dbf425..e361a97102b 100644 --- a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActivityInfoProvider.scala +++ b/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ActionInfoProvider.scala @@ -4,8 +4,8 @@ import pl.touk.nussknacker.engine.api.ProcessVersion import pl.touk.nussknacker.engine.api.component.ParameterConfig import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess -trait ActivityInfoProvider { +trait ActionInfoProvider { - def getActivityParameters(processVersion: ProcessVersion, scenario: CanonicalProcess): Map[String, Map[String, Map[String, ParameterConfig]]] + def getActionParameters(processVersion: ProcessVersion, scenario: CanonicalProcess): Map[String, Map[String, Map[String, ParameterConfig]]] } diff --git a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ModelDataActivityInfoProvider.scala b/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ModelDataActivityInfoProvider.scala index 55d9d556333..7c1f0430de2 100644 --- a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ModelDataActivityInfoProvider.scala +++ b/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/definition/activity/ModelDataActivityInfoProvider.scala @@ -3,7 +3,7 @@ package pl.touk.nussknacker.engine.definition.activity import cats.data.Validated.Valid import pl.touk.nussknacker.engine.ModelData import pl.touk.nussknacker.engine.api.component.ParameterConfig -import pl.touk.nussknacker.engine.api.process.WithActivityParameters +import pl.touk.nussknacker.engine.api.process.WithActionParameters import pl.touk.nussknacker.engine.api.{JobData, MetaData, NodeId, ProcessVersion} import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess import pl.touk.nussknacker.engine.graph.node.SourceNodeData @@ -11,9 +11,9 @@ import pl.touk.nussknacker.engine.util.Implicits.RichScalaMap class ModelDataActivityInfoProvider(modelData: ModelData) extends CommonModelDataInfoProvider(modelData) - with ActivityInfoProvider { + with ActionInfoProvider { - override def getActivityParameters( + override def getActionParameters( processVersion: ProcessVersion, scenario: CanonicalProcess ): Map[String, Map[String, Map[String, ParameterConfig]]] = { @@ -45,8 +45,8 @@ class ModelDataActivityInfoProvider(modelData: ModelData) modelData.withThisAsContextClassLoader { val compiledSource = prepareSourceObj(source)(jobData, NodeId(source.id)) compiledSource match { - case Valid(s: WithActivityParameters) => s.activityParametersDefinition - case _ => Map.empty + case Valid(s: WithActionParameters) => s.actionParametersDefinition + case _ => Map.empty } } }