Skip to content

Commit

Permalink
[2130] Insert OA in an [OAIB] diagram failed
Browse files Browse the repository at this point in the history
Bug 2130

Change-Id: I0e1e7ff9d3b95d88f9548f3cad4489a70474f4f4
Signed-off-by: Ali Akar <ali.akar82@gmail.com>
  • Loading branch information
aliakar82 committed Aug 20, 2018
1 parent 9652913 commit b98b203
Show file tree
Hide file tree
Showing 8 changed files with 1,333 additions and 212 deletions.

Large diffs are not rendered by default.

Expand Up @@ -35,8 +35,8 @@ public XDFBDiagram(BlockArchitectureExt.Type type, SessionContext context, DDiag
}

public static XDFBDiagram createDiagram(SessionContext executionContext, String targetIdentifier) {
BlockArchitecture architecture = BlockArchitectureExt.getRootBlockArchitecture(executionContext
.getSemanticElement(targetIdentifier));
BlockArchitecture architecture = BlockArchitectureExt
.getRootBlockArchitecture(executionContext.getSemanticElement(targetIdentifier));
final BlockArchitectureExt.Type type = BlockArchitectureExt.getBlockArchitectureType(architecture);

String name = null;
Expand Down Expand Up @@ -85,7 +85,7 @@ public void createFunction(String id, String containerId) {
}
new CreateContainerTool(this, name, containerId, id).run();
}

public void createActorFunction(String id) {
createActorFunction(id, getDiagramId());
}
Expand All @@ -101,8 +101,9 @@ public void createActorFunction(String id, String containerId) {
}
new CreateContainerTool(this, name, containerId, id).run();
}

public void createFunctionalExchange(String id, String sourceViewId, String targetViewId, String newSourceIdentifier, String newTargetIdentifier) {

public void createFunctionalExchange(String id, String sourceViewId, String targetViewId, String newSourceIdentifier,
String newTargetIdentifier) {
String name = null;
if (type == Type.OA) {
name = IToolNameConstants.TOOL_OAIB_CREATE_INTERACTION;
Expand All @@ -115,56 +116,60 @@ public void createFunctionalExchange(String id, String sourceViewId, String targ
}
new CreateDEdgeTool(this, name, sourceViewId, targetViewId, id, newSourceIdentifier, newTargetIdentifier).run();
}

public void createFunctionalExchange(String id, String sourceViewId, String targetViewId) {
createFunctionalExchange(id, sourceViewId, targetViewId, null, null);
}

public void initializationFromExistingDiagram(DiagramContext existingContext) {
new InitializationFromExistingDiagramTool(this, IToolNameConstants.TOOL_SDFB_INITIALIZATION_FROM_EXISTING_DIAGRAM, existingContext).insert(existingContext.getDiagramId());
new InitializationFromExistingDiagramTool(this, IToolNameConstants.TOOL_SDFB_INITIALIZATION_FROM_EXISTING_DIAGRAM,
existingContext).insert(existingContext.getDiagramId());
}
public void insertFunction(String containerId, String id){
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);

public void insertFunction(String containerId, String id) {
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONS, containerId).insert(id);
} else if (type == Type.OA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_OAIB_INSERT_REMOVE_OPERATIONAL_ACTIVITIES, containerId)
.insert(id);
}
}
public void removeFunction(String containerId, String id){
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
}

public void removeFunction(String containerId, String id) {
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONS, containerId).remove(id);
}
}
public void insertFunctionalExchange(String containerId, String id){
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);

public void insertFunctionalExchange(String containerId, String id) {
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).insert(id);
}
}
public void removeFunctionalExchange(String containerId, String id){
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
}

public void removeFunctionalExchange(String containerId, String id) {
if (type == Type.SA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_SDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
} else if (type == Type.LA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_LDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
} else if (type == Type.PA) {
new InsertRemoveTool(this, IToolNameConstants.TOOL_PDFB_SHOW_HIDE_FUNCTIONAL_EXCHANGES, containerId).remove(id);
}
}

public void createFunctionalChain(String path, String ...links) {
public void createFunctionalChain(String path, String... links) {
new CreatePathTool(this, IToolNameConstants.TOOL_CREATE_FUNCTIONAL_CHAIN, path, links).run();
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>org.polarsys.capella.project.nature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata:Metadata xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:metadata="http://www.polarsys.org/kitalpha/ad/metadata/1.0.0" id="_PCuDMLpkEeeRxJoRAeHdNw">
<viewpointReferences id="_Pj2aULpkEeeRxJoRAeHdNw" vpId="org.polarsys.capella.core.viewpoint" version="1.3.0"/>
</metadata:Metadata>

0 comments on commit b98b203

Please sign in to comment.