Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeruntimecontextdependency force flag #1306

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/clicommands/RemoveRuntimeContextDependency.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Copyright 2022 Xyna GmbH, Germany
* Copyright 2024 Xyna GmbH, Germany
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,4 +23,5 @@
<Argument Name="requirementApplicationName" Description="The name of the required application." Optional="true"/>
<Argument Name="requirementVersionName" Description="The name of the required application version." Optional="true"/>
<Argument Name="requirementWorkspaceName" Description="The name of the required workspace." Optional="true"/>
<BoolOption Name="f" LongName="force" Description="Ignore nonfatal validation errors" Optional="true"/>
</XynaCommandLineCommand>
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,22 @@ public ChangeResult addDependency(RuntimeDependencyContext owner, RuntimeDepende
return ChangeResult.Succeeded;
}


public ChangeResult removeDependency(RuntimeDependencyContext owner, RuntimeDependencyContext dependency, String user) throws PersistenceLayerException, XFMG_CouldNotModifyRuntimeContextDependenciesException {
public ChangeResult removeDependency(RuntimeDependencyContext owner, RuntimeDependencyContext dependency, String user, boolean force) throws PersistenceLayerException, XFMG_CouldNotModifyRuntimeContextDependenciesException {
List<RuntimeDependencyContext> newDependencies = new ArrayList<RuntimeDependencyContext>(getDependencies(owner));
if (!newDependencies.contains(dependency)) {
return ChangeResult.NoChange;
}

newDependencies.remove(dependency);
modifyDependencies(owner, newDependencies, user);
modifyDependencies(owner, newDependencies, user, force, true);

return ChangeResult.Succeeded;
}

public ChangeResult removeDependency(RuntimeDependencyContext owner, RuntimeDependencyContext dependency, String user) throws PersistenceLayerException, XFMG_CouldNotModifyRuntimeContextDependenciesException {
return removeDependency(owner, dependency, user, false);
}


public void modifyDependencies(RuntimeDependencyContext owner, List<RuntimeDependencyContext> newDependencies, String user) throws PersistenceLayerException, XFMG_CouldNotModifyRuntimeContextDependenciesException {
modifyDependencies(owner, newDependencies, user, false, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void execute(OutputStream statusOutputStream, Removeruntimecontextdepende

ChangeResult result;
RuntimeContextDependencyManagement rcdMgmt = XynaFactory.getInstance().getFactoryManagement().getXynaFactoryControl().getRuntimeContextDependencyManagement();
result = rcdMgmt.removeDependency(owner, requirement, TemporarySessionAuthentication.TEMPORARY_CLI_USER_NAME);
result = rcdMgmt.removeDependency(owner, requirement, TemporarySessionAuthentication.TEMPORARY_CLI_USER_NAME, payload.getForce());

switch(result) {
case Succeeded:
Expand Down
Loading