Search in sources :

Example 11 with ResourceReference

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);
}
Also used : ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference)

Example 12 with ResourceReference

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);
}
Also used : ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference)

Example 13 with ResourceReference

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]);
        }
    }
}
Also used : ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference) ConnectiveConstraint(org.drools.workbench.models.datamodel.rule.ConnectiveConstraint) CompositeFieldConstraint(org.drools.workbench.models.datamodel.rule.CompositeFieldConstraint) SingleFieldConstraint(org.drools.workbench.models.datamodel.rule.SingleFieldConstraint) FieldConstraint(org.drools.workbench.models.datamodel.rule.FieldConstraint)

Example 14 with ResourceReference

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);
}
Also used : ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference)

Example 15 with ResourceReference

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);
    }
}
Also used : Characteristic(org.drools.workbench.models.guided.scorecard.shared.Characteristic) ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference) Imports(org.kie.soup.project.datamodel.imports.Imports)

Aggregations

ResourceReference (org.kie.workbench.common.services.refactoring.ResourceReference)15 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)2 Map (java.util.Map)1 EnumLiteralDescr (org.drools.compiler.lang.descr.EnumLiteralDescr)1 CompositeFieldConstraint (org.drools.workbench.models.datamodel.rule.CompositeFieldConstraint)1 ConnectiveConstraint (org.drools.workbench.models.datamodel.rule.ConnectiveConstraint)1 FieldConstraint (org.drools.workbench.models.datamodel.rule.FieldConstraint)1 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)1 Characteristic (org.drools.workbench.models.guided.scorecard.shared.Characteristic)1 FactData (org.drools.workbench.models.testscenarios.shared.FactData)1 Field (org.drools.workbench.models.testscenarios.shared.Field)1 Fixture (org.drools.workbench.models.testscenarios.shared.Fixture)1 FixtureList (org.drools.workbench.models.testscenarios.shared.FixtureList)1 FixturesMap (org.drools.workbench.models.testscenarios.shared.FixturesMap)1 VerifyFact (org.drools.workbench.models.testscenarios.shared.VerifyFact)1 VerifyField (org.drools.workbench.models.testscenarios.shared.VerifyField)1 VerifyRuleFired (org.drools.workbench.models.testscenarios.shared.VerifyRuleFired)1 Imports (org.kie.soup.project.datamodel.imports.Imports)1 Resource (org.kie.workbench.common.services.refactoring.Resource)1 SharedPart (org.kie.workbench.common.services.refactoring.SharedPart)1