-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1772] Refactor ScenarioActivity state handling (#7007)
- Loading branch information
Showing
22 changed files
with
499 additions
and
343 deletions.
There are no files selected for viewing
26 changes: 2 additions & 24 deletions
26
...pi/src/main/scala/pl/touk/nussknacker/engine/api/deployment/ScenarioActivityManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,19 @@ | ||
package pl.touk.nussknacker.engine.api.deployment | ||
|
||
import pl.touk.nussknacker.engine.api.deployment.ScenarioActivityManager.ModificationResult | ||
|
||
import scala.concurrent.Future | ||
|
||
trait ScenarioActivityManager { | ||
|
||
def saveActivity( | ||
scenarioActivity: ScenarioActivity | ||
activity: DeploymentRelatedActivity | ||
): Future[Unit] | ||
|
||
def modifyActivity( | ||
scenarioActivityId: ScenarioActivityId, | ||
modify: ScenarioActivity => ScenarioActivity, | ||
): Future[ModificationResult] | ||
|
||
} | ||
|
||
object ScenarioActivityManager { | ||
sealed trait ModificationResult | ||
|
||
object ModificationResult { | ||
case object Success extends ModificationResult | ||
case object Failure extends ModificationResult | ||
} | ||
|
||
} | ||
|
||
object NoOpScenarioActivityManager extends ScenarioActivityManager { | ||
|
||
def saveActivity( | ||
scenarioActivity: ScenarioActivity | ||
activity: DeploymentRelatedActivity | ||
): Future[Unit] = Future.unit | ||
|
||
def modifyActivity( | ||
scenarioActivityId: ScenarioActivityId, | ||
modify: ScenarioActivity => ScenarioActivity, | ||
): Future[ModificationResult] = Future.successful(ModificationResult.Success) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.