use of org.kie.workbench.common.services.refactoring.ResourceReference in project drools-wb by kiegroup.
the class GuidedRuleTemplateIndexVisitor method visitConnectiveConstraint.
private void visitConnectiveConstraint(final ConnectiveConstraint cc) {
ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(cc.getFactType()), ResourceType.JAVA);
resRef.addPartReference(cc.getFieldName(), PartType.FIELD);
addResourceReference(getFullyQualifiedClassName(cc.getFieldType()), ResourceType.JAVA);
}
use of org.kie.workbench.common.services.refactoring.ResourceReference in project drools-wb by kiegroup.
the class GuidedRuleTemplateIndexVisitor method visit.
private void visit(final String fullyQualifiedClassName, final ActionFieldValue afv) {
ResourceReference resRef = addResourceReference(fullyQualifiedClassName, ResourceType.JAVA);
resRef.addPartReference(afv.getField(), PartType.FIELD);
addResourceReference(getFullyQualifiedClassName(afv.getType()), ResourceType.JAVA);
}
use of org.kie.workbench.common.services.refactoring.ResourceReference in project drools-wb by kiegroup.
the class GuidedRuleTemplateIndexVisitor method visitSingleFieldConstraint.
private void visitSingleFieldConstraint(final SingleFieldConstraint sfc) {
ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(sfc.getFactType()), ResourceType.JAVA);
resRef.addPartReference(sfc.getFieldName(), PartType.FIELD);
addResourceReference(getFullyQualifiedClassName(sfc.getFieldType()), ResourceType.JAVA);
if (sfc.getConnectives() != null) {
for (int i = 0; i < sfc.getConnectives().length; i++) {
visit(sfc.getConnectives()[i]);
}
}
}
use of org.kie.workbench.common.services.refactoring.ResourceReference in project drools-wb by kiegroup.
the class GuidedScoreCardIndexVisitor method visit.
private void visit(final Characteristic c) {
// Add type
final String typeName = c.getFact();
final String fullyQualifiedClassName = getFullyQualifiedClassName(typeName);
ResourceReference resRef = addResourceReference(fullyQualifiedClassName, ResourceType.JAVA);
// Add field
final String fieldName = c.getField();
final String fieldFullyQualifiedClassName = getFieldFullyQualifiedClassName(fullyQualifiedClassName, fieldName);
resRef.addPartReference(fieldName, PartType.FIELD);
addResourceReference(fieldFullyQualifiedClassName, ResourceType.JAVA);
}
use of org.kie.workbench.common.services.refactoring.ResourceReference in project drools-wb by kiegroup.
the class GuidedScoreCardIndexVisitor method visit.
public void visit() {
// Add type
final String typeName = model.getFactName();
if (typeName == null || typeName.isEmpty()) {
return;
}
final String fullyQualifiedClassName = getFullyQualifiedClassName(typeName);
ResourceReference resRef = addResourceReference(fullyQualifiedClassName, ResourceType.JAVA);
// Add field
final String fieldName = model.getFieldName();
if (fieldName == null || fieldName.isEmpty()) {
return;
}
resRef.addPartReference(fieldName, PartType.FIELD);
final String fieldFullyQualifiedClassName = getFieldFullyQualifiedClassName(fullyQualifiedClassName, fieldName);
addResourceReference(fieldFullyQualifiedClassName, ResourceType.JAVA);
// Add Characteristics
for (Characteristic c : model.getCharacteristics()) {
visit(c);
}
// agenda-group, ruleflow-group
String agendaGroup = model.getAgendaGroup();
if (agendaGroup != null && !agendaGroup.isEmpty()) {
addSharedReference(agendaGroup, PartType.AGENDA_GROUP);
}
String ruleFlowGroup = model.getRuleFlowGroup();
if (ruleFlowGroup != null && !ruleFlowGroup.isEmpty()) {
addSharedReference(ruleFlowGroup, PartType.RULEFLOW_GROUP);
}
String modelName = model.getName();
if (modelName != null && !modelName.isEmpty()) {
addSharedReference(modelName, PartType.SCORECARD_MODEL_NAME);
}
Imports imports = model.getImports();
if (imports != null) {
visit(imports);
}
}
Aggregations