use of org.talend.repository.services.action.AssignJobAction in project tesb-studio-se by Talend.
the class LocalWSDLEditor method save.
private void save() {
try {
saveModel();
// update
RepositoryUpdateManager.updateServices(serviceItem);
ProxyRepositoryFactory.getInstance().save(serviceItem);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
if (service != null) {
service.refreshComponentView(serviceItem);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
// ////////// TODO: remove this ugly patch! do correct changeset
EList<ServicePort> servicePorts = ((ServiceConnection) serviceItem.getConnection()).getServicePort();
for (ServicePort servicePort : servicePorts) {
List<IRepositoryNode> portNodes = repositoryNode.getChildren();
IRepositoryNode portNode = null;
for (IRepositoryNode node : portNodes) {
if (node.getObject().getLabel().equals(servicePort.getName())) {
portNode = node;
}
}
if (portNode == null) {
// for now, if the port has been renamed, we just lose all links (avoid an NPE for nothing)
continue;
}
EList<ServiceOperation> operations = servicePort.getServiceOperation();
for (ServiceOperation operation : operations) {
String referenceJobId = operation.getReferenceJobId();
if (referenceJobId != null) {
for (IRepositoryNode operationNode : portNode.getChildren()) {
if (operationNode.getObject().getLabel().startsWith(operation.getName() + '-')) {
IRepositoryNode jobNode = org.talend.core.repository.seeker.RepositorySeekerManager.getInstance().searchRepoViewNode(referenceJobId, false);
AssignJobAction action = new AssignJobAction((RepositoryNode) operationNode);
action.assign(jobNode);
break;
}
}
}
}
}
}
Aggregations