use of com.twinsoft.convertigo.eclipse.views.references.model.TransactionStepNode in project convertigo by convertigo.
the class ReferencesView method getConnectorReferencingIsUsedBy.
private void getConnectorReferencingIsUsedBy(Step step, ProjectExplorerView projectExplorerView, SequenceNode sequenceNode, List<Transaction> transactions, String connectorProjectName, String connectorSelectedName) {
if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String sourcetransaction = transactionStep.getSourceTransaction();
for (Transaction transaction : transactions) {
if (sourcetransaction.equals(connectorProjectName + RequestableStep.SOURCE_SEPARATOR + connectorSelectedName + RequestableStep.SOURCE_SEPARATOR + transaction.getName())) {
sequenceNode.addChild(new TransactionStepNode(sequenceNode, step.getName(), step));
}
}
} else if (isStepContainer(step)) {
List<Step> steps = getStepList(step);
for (Step s : steps) {
getConnectorReferencingIsUsedBy(s, projectExplorerView, sequenceNode, transactions, connectorProjectName, connectorSelectedName);
}
}
}
use of com.twinsoft.convertigo.eclipse.views.references.model.TransactionStepNode in project convertigo by convertigo.
the class ReferencesView method handleCallStepselection.
private void handleCallStepselection(Object firstElement) {
try {
ProjectExplorerView projectExplorerView = ConvertigoPlugin.getDefault().getProjectExplorerView();
StepTreeObject stepTreeObject = (StepTreeObject) firstElement;
Step step = stepTreeObject.getObject();
RootNode root = new RootNode();
if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String transactionStepName = transactionStep.getName();
TransactionStepNode transactionStepNode = new TransactionStepNode(root, transactionStepName, transactionStep);
RequiresNode requiresNode = new RequiresNode(transactionStepNode, "Requires");
String transactionName = transactionStep.getTransactionName();
String connectorName = transactionStep.getConnectorName();
String projectName = transactionStep.getProjectName();
Project project = getProject(projectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(requiresNode, projectName, project);
Connector connector = null;
Transaction transaction = null;
try {
if (project != null) {
connector = project.getConnectorByName(connectorName);
if (connector != null) {
transaction = connector.getTransactionByName(transactionName);
}
}
} catch (EngineException e) {
connector = null;
transaction = null;
}
ConnectorNode connectorNode = getConnectorNode(projectNode, connector);
if (connectorNode == null)
connectorNode = new ConnectorNode(projectNode, connectorName, connector);
projectNode.addChild(connectorNode);
TransactionNode transactionNode = new TransactionNode(projectNode, transactionName, transaction);
connectorNode.addChild(transactionNode);
requiresNode.addChild(projectNode);
transactionStepNode.addChild(requiresNode);
root.addChild(transactionStepNode);
} else if (step instanceof SequenceStep) {
SequenceStep sequenceStep = (SequenceStep) step;
String sequenceStepName = sequenceStep.getName();
SequenceStepNode sequenceStepNode = new SequenceStepNode(root, sequenceStepName, sequenceStep);
RequiresNode requiresNode = new RequiresNode(sequenceStepNode, "Requires");
String sequenceName = sequenceStep.getSequenceName();
String projectName = sequenceStep.getProjectName();
Project project = getProject(projectName, projectExplorerView);
ProjectNode projectNode = new ProjectNode(requiresNode, projectName, project);
Sequence sequence = null;
try {
if (project != null)
sequence = project.getSequenceByName(sequenceName);
} catch (EngineException e) {
sequence = null;
}
projectNode.addChild(new SequenceNode(projectNode, sequenceName, sequence));
requiresNode.addChild(projectNode);
sequenceStepNode.addChild(requiresNode);
root.addChild(sequenceStepNode);
} else {
root.addChild(new InformationNode(root, "References are not handled for this object"));
treeViewer.setInput(root);
}
treeViewer.setInput(root);
treeViewer.expandAll();
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Error while analyzing the projects hierarchy", true);
}
}
use of com.twinsoft.convertigo.eclipse.views.references.model.TransactionStepNode in project convertigo by convertigo.
the class ReferencesView method getUsedRequestables.
private void getUsedRequestables(Step step, Project projectSelected, AbstractParentNode parentNode) {
try {
if (step instanceof SequenceStep) {
SequenceStep sequenceStep = (SequenceStep) step;
String sourceProjectName = sequenceStep.getProjectName();
if (sourceProjectName.equals(projectSelected.getName())) {
Sequence sourceSequence = null;
String sourceSequenceName = sequenceStep.getSequenceName();
try {
if (projectSelected != null)
sourceSequence = projectSelected.getSequenceByName(sourceSequenceName);
} catch (EngineException e) {
sourceSequence = null;
}
SequenceStepNode sequenceStepNode = new SequenceStepNode(parentNode, step.getName() + " -> " + sequenceStep.getSourceSequence(), sourceSequence);
parentNode.addChild(sequenceStepNode);
}
} else if (step instanceof TransactionStep) {
TransactionStep transactionStep = (TransactionStep) step;
String sourceProjectName = transactionStep.getProjectName();
if (sourceProjectName.equals(projectSelected.getName())) {
Transaction sourceTransaction = null;
Connector connectorSelected = projectSelected.getConnectorByName(transactionStep.getConnectorName());
try {
if (connectorSelected != null)
sourceTransaction = connectorSelected.getTransactionByName(transactionStep.getTransactionName());
} catch (Exception e) {
sourceTransaction = null;
}
TransactionStepNode transactionStepNode = new TransactionStepNode(parentNode, step.getName() + " -> " + ((TransactionStep) step).getSourceTransaction(), sourceTransaction);
parentNode.addChild(transactionStepNode);
}
} else if (isStepContainer(step)) {
List<Step> steps = getStepList(step);
if (steps != null) {
for (Step s : steps) {
getUsedRequestables(s, projectSelected, parentNode);
}
}
}
} catch (EngineException e) {
ConvertigoPlugin.logException(e, "Unable to load the project", true);
}
}
Aggregations