This can also be done from Java. The following demonstrates it, assuming ‘context’ is an instance variable pointing to a connected com.wm.app.b2b.client.Context object:
private List<string> getDependents(final String node) throws ServiceException {
final List<string> dependents = new ArrayList<string>();
Values input = new Values();
input.put("node", node);
Values result = context.invoke("wm.server.ns.dependency", "getDependent", input);
Values dependent = (Values) result.get("dependent");
Values[] referencedBy = (Values[]) dependent.get("referencedBy");
for (Values v : referencedBy) {
dependents.add((String)v.getValue("name"));
}
return dependents;
}
As stated elsewhere on this site, ‘getDependents’ is an internal service which is not publicly visible. Therefore, it is unsupported and subject to change without notice. The above works on wM 6.1, I suspect it would also work on 6.5, at least.
While I’m at it, the following code is useful for interrogating ‘Values’ objects, when you don’t know what they contain:
private void logValuesInfo(String name, Values values) {
final StringBuffer result = new StringBuffer("Information for values object '" + name + "':");
if (values != null) {
String[] keys = values.getValueKeys();
for (String key : keys) {
Object value = values.getValue(key);
String valueClass = value == null ? "" : "(" + value.getClass().getName() + ")";
result.append("\n '").append(key).append("'=>'");
result.append(LogUtil.lu().format(value)).append("'").append(valueClass);
}
} else {
result.append("null");
}
LOG.debug(result.toString());
}</String></String></String>
#Integration-Server-and-ESB#webMethods