Compare commits

...

6 Commits

Author SHA1 Message Date
apoltavtsev
11dc3a19ee Update FileinToDelimitedProcess.java 2020-12-02 20:29:51 +01:00
apoltavtsev
9a35a8b015 Update FileinToXmlProcess.java 2020-12-02 20:28:04 +01:00
apoltavtsev
4f19e6929a Update Process.java 2020-12-02 20:25:43 +01:00
apoltavtsev
ceee9ec5ad Update FileinToXmlProcess.java 2020-12-02 19:38:56 +01:00
apoltavtsev
8ca9da4067 Update FileinToDelimitedProcess.java 2020-12-02 19:36:47 +01:00
apoltavtsev
01374355a1 Update Process.java 2020-12-02 18:23:42 +01:00
3 changed files with 82 additions and 0 deletions

View File

@@ -3766,6 +3766,57 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
return matchingNodes;
}
@SuppressWarnings("unchecked")
@Override
public boolean checkPresenceGraphicalNodeOfType(String componentName) {
if (checkPresenceNodeOfType(componentName, (List<INode>) getGraphicalNodes())) {
return true;
}
return false;
};
private boolean checkPresenceNodeOfType(String componentName, List<INode> generatingNodes) {
if (componentName == null) {
return false;
}
for (INode node : new ArrayList<>(generatingNodes)) {
if (node.isActivate()) {
if (componentName.startsWith("FAMILY:")) { //$NON-NLS-1$
String familly = componentName.substring("FAMILY:".length()); //$NON-NLS-1$
if (node.getComponent().getOriginalFamilyName().startsWith(familly)) {
return true;
}
} else if (componentName.startsWith("REGEXP:")) { //$NON-NLS-1$
Perl5Matcher matcher = new Perl5Matcher();
Perl5Compiler compiler = new Perl5Compiler();
Pattern pattern;
String regexp = componentName.substring("REGEXP:".length()); //$NON-NLS-1$
try {
pattern = compiler.compile(regexp);
if (matcher.matches(node.getComponent().getName(), pattern)) {
return true;
}
} catch (MalformedPatternException e) {
throw new RuntimeException(e);
}
} else if ((node.getComponent().getName() != null)) {
if (node.getComponent().getName().compareTo(componentName) == 0) {
return true;
} else if (node.getComponent() instanceof EmfComponent) {
EmfComponent component = (EmfComponent) node.getComponent();
String eqCompName = component.getEquivalent();
if (componentName.equals(eqCompName)) {
return true;
}
}
}
}
}
return false;
}
private List<INode> getRealGraphicalNodesFromVirtrualNodes(List<INode> generatingNodes) {
Set<INode> set = new HashSet<INode>();

View File

@@ -614,6 +614,25 @@ public class FileinToDelimitedProcess<K extends FileInputNode> extends Repositor
}
return matchingNodes;
}
@Override
public boolean checkPresenceGraphicalNodeOfType(String componentName) {
if ((prejob != null) && (prejob.getComponentName() != null) && (prejob.getComponentName().compareTo(componentName) == 0)) {
return true;
}
if ((setProxy != null) && (setProxy.getComponentName() != null)
&& (setProxy.getComponentName().compareTo(componentName) == 0)) {
return true;
}
if ((inNode != null) && (inNode.getComponentName() != null) && (inNode.getComponentName().compareTo(componentName) == 0)) {
return true;
}
if ((outNode != null) && (outNode.getComponentName() != null)
&& (outNode.getComponentName().compareTo(componentName) == 0)) {
return true;
}
return false;
}
@Override
public boolean checkValidConnectionName(String connectionName, boolean checkExists) {

View File

@@ -574,6 +574,18 @@ public class FileinToXmlProcess<K extends FileInputNode> extends RepositoryObjec
}
return matchingNodes;
}
@Override
public boolean checkPresenceGraphicalNodeOfType(String componentName) {
if ((inNode != null) && (inNode.getComponentName() != null) && (inNode.getComponentName().compareTo(componentName) == 0)) {
return true;
}
if ((outNode != null) && (outNode.getComponentName() != null)
&& (outNode.getComponentName().compareTo(componentName) == 0)) {
return true;
}
return false;
}
@Override
public boolean checkValidConnectionName(String connectionName, boolean checkExists) {