use of com.centurylink.mdw.workflow.WorkflowEnvironment in project mdw-designer by CenturyLinkCloud.
the class MdwWorkbenchWindowAdvisor method getWorkflowProject.
private WorkflowProject getWorkflowProject(String host, String port, String contextRoot) throws DiscoveryException {
BigInteger portInt = new BigInteger(port);
WorkflowApplication matchingWorkflowApp = null;
WorkflowEnvironment matchingWorkflowEnv = null;
boolean isLocalhost = "localhost".equals(host);
List<WorkflowApplication> workflowApps = WorkflowProjectManager.getInstance().discoverWorkflowApps();
for (WorkflowApplication workflowApp : workflowApps) {
if (isLocalhost) {
// right info except host and port
if (workflowApp.getWebContextRoot().equals(contextRoot) || (workflowApp.getServicesContextRoot() != null && workflowApp.getServicesContextRoot().equals(contextRoot))) {
matchingWorkflowApp = workflowApp;
matchingWorkflowEnv = workflowApp.getEnvironmentList().get(0);
ManagedNode server = matchingWorkflowEnv.getManagedServerList().get(0);
server.setHost(host);
server.setPort(new BigInteger(port));
break;
}
} else {
for (WorkflowEnvironment workflowEnv : workflowApp.getEnvironmentList()) {
for (ManagedNode server : workflowEnv.getManagedServerList()) {
if (server.getHost().equals(host) && server.getPort().equals(portInt)) {
if (matchingWorkflowEnv == null) {
matchingWorkflowEnv = workflowEnv;
matchingWorkflowApp = workflowApp;
} else {
// context root is only used to break a tie
if (workflowApp.getWebContextRoot().equals(contextRoot) || (workflowApp.getServicesContextRoot() != null && workflowApp.getServicesContextRoot().equals(contextRoot))) {
matchingWorkflowEnv = workflowEnv;
matchingWorkflowApp = workflowApp;
}
}
}
}
}
}
}
if (matchingWorkflowApp == null)
return null;
return new WorkflowProject(matchingWorkflowApp, matchingWorkflowEnv);
}
use of com.centurylink.mdw.workflow.WorkflowEnvironment in project mdw-designer by CenturyLinkCloud.
the class ImportProjectPage method populateProjectList.
public void populateProjectList() {
List<WorkflowProject> projectList = new ArrayList<>();
String workflowApp = applicationCombo.getText();
if (discoveredWorkflowApps != null) {
for (WorkflowApplication discoveredApp : discoveredWorkflowApps) {
if (workflowApp.equals(discoveredApp.getName())) {
// set the project list
for (WorkflowEnvironment workflowEnv : discoveredApp.getEnvironmentList()) {
WorkflowProject project = new WorkflowProject(discoveredApp, workflowEnv);
projectList.add(project);
}
break;
}
}
}
setProjectList(projectList);
((ImportProjectWizard) getWizard()).initializeProjectSelectPage();
}
Aggregations