Forum Replies Created
-
gnana
Moderator3 years, 1 month ago in reply to: How to call functions in another entity ? #3318::We have 2 options.
1. write code to traverse in BP.
2.Write code in query builder.1. Here is the script to traverse from windows entity to service entity
Write a function at Service Level to get the status (GetRunnableStatus).
Write a custom groovy function at windows level. Call the above function after you traverse.
nodeWindowsTarget = subject;
com.digitate.ignio.data.graph.model.criteria.Filter filterAcademy = new com.digitate.ignio.data.graph.model.criteria.Filter();
filterAcademy.setField(“HostName”);
filterAcademy.setValue(subject.nodeProperties.HostName);
filterAcademy.setOperator(“=”);
List<com.digitate.ignio.data.graph.model.criteria.Filter> listFilter = new ArrayList<>();
listFilter.add(filterAcademy);
com.digitate.ignio.data.graph.model.criteria.Filters filtersAcademy = new com.digitate.ignio.data.graph.model.criteria.Filters();
filtersAcademy.setFilters(listFilter);
nodeWindowsTarget.setFilters(filtersAcademy);
com.digitate.ignio.utils.ceb.model.NodeRelationship relationshipAcademy = new com.digitate.ignio.utils.ceb.model.NodeRelationship();
relationshipAcademy.setDirection(com.digitate.ignio.data.graph.model.Direction.OUT);
relationshipAcademy.setRelationshipType(“has”);
nodeWindowsTarget.setNodeRelationship(relationshipAcademy);
def ServiceNode;
def myNode = new IgnioNode()
myNode = node.getRelatedNodeByRelationship(nodeWindowsTarget, true);
for (Object nodeRelationship : myNode.getNodeRelationships())
{
boolean nodeFound = false;
if (nodeRelationship != null) {
for (IgnioNode rNode : nodeRelationship.getRelatedNodes()) {
def rLabel = rNode.getLabel();
if (rLabel.trim().equals(“Academy_Service”)) {
ServiceNode = rNode;
nodeFound = true;
break;
}
}
}
if (nodeFound) break;
}
retMap = ServiceNode.getRunnableStatus();A sample script for Query Builder:
String query = “GraphQuery.node(‘tom:TomcatApplication’).out(‘r1:StoreDataOn’, null).node(‘oraDB:OracleDatabase’).properties(‘tom.Name’, ‘ACME’, ‘oraDB.DBName’, ‘DB01’)”
try {
def iNode = node.executeQuery(query)for (Object node : iNode)
{
def outMap = node.getRunnableStatus()
}
} catch (Exception ex) {}
gnana
Moderator3 years, 1 month ago in reply to: Custom cmdb and dynamic data adaptor document #3319gnana
Moderator2 years, 10 months ago in reply to: Custom cmdb and dynamic data adaptor document #3548::I am unable to post it in Confluence, not sure if I need any permissions. I will check with Sameer Natu and respond. if you need urgently, I can share by email.
gnana
Moderator2 years, 10 months ago in reply to: Custom cmdb and dynamic data adaptor document #3550::Pls refer to this page..
https://digitate.atlassian.net/wiki/spaces/DA/pages/2370339386/AIops+User+Story+CMDB