Search in sources :

Example 1 with SharedPart

use of org.kie.workbench.common.services.refactoring.SharedPart in project kie-wb-common by kiegroup.

the class AbstractFileIndexer method addReferencedResourcesToIndexBuilder.

/**
 * This method adds the index terms necessary for impact analysis to the {@link DefaultIndexBuilder}, which is basically
 * the lucene doc for a resource.
 * @param builder The {@link DefaultIndexBuilder} instance for a resource
 * @param resRefCollector A collector containing info (resources, references) on the asset indexed
 * to other resources that an indexed resource has.
 */
protected void addReferencedResourcesToIndexBuilder(DefaultIndexBuilder builder, ResourceReferenceCollector resRefCollector) {
    Collection<ResourceReference> referencedResources = resRefCollector.getResourceReferences();
    if (!referencedResources.isEmpty()) {
        for (ResourceReference resourceRef : referencedResources) {
            builder.addGenerator(resourceRef);
        }
    }
    Collection<SharedPart> sharedReferences = resRefCollector.getSharedReferences();
    if (!sharedReferences.isEmpty()) {
        for (SharedPart sharedRef : sharedReferences) {
            builder.addGenerator(sharedRef);
        }
    }
    Collection<Resource> resources = resRefCollector.getResources();
    if (!resources.isEmpty()) {
        for (Resource res : resources) {
            builder.addGenerator(res);
        }
    }
}
Also used : Resource(org.kie.workbench.common.services.refactoring.Resource) ResourceReference(org.kie.workbench.common.services.refactoring.ResourceReference) SharedPart(org.kie.workbench.common.services.refactoring.SharedPart)

Example 2 with SharedPart

use of org.kie.workbench.common.services.refactoring.SharedPart in project kie-wb-common by kiegroup.

the class PackageDescrIndexVisitor method visit.

protected void visit(final AttributeDescr descr) {
    String attr = descr.getName();
    switch(attr) {
        case "no-loop":
        case "lock-on-active":
        case "salience":
        case "auto-focus":
        case "dialect":
        case "date-effective":
        case "date-expires":
        case "enabled":
        case "duration":
        case "timer":
        case "calendars":
            return;
    }
    PartType type = PartType.getPartTypeFromAttribueDescrName(descr.getName());
    switch(type) {
        case AGENDA_GROUP:
        case ACTIVATION_GROUP:
        case RULEFLOW_GROUP:
            SharedPart sharedRef = new SharedPart(descr.getValue(), type);
            builder.addGenerator(sharedRef);
            break;
        default:
            throw new UnsupportedOperationException("Unsupported attribute encountered: " + descr.getName());
    }
}
Also used : PartType(org.kie.workbench.common.services.refactoring.service.PartType) SharedPart(org.kie.workbench.common.services.refactoring.SharedPart)

Example 3 with SharedPart

use of org.kie.workbench.common.services.refactoring.SharedPart in project drools-wb by kiegroup.

the class GuidedRuleTemplateIndexVisitor method visitRuleAttribute.

private void visitRuleAttribute(final RuleAttribute attr) {
    PartType type = PartType.getPartTypeFromAttribueDescrName(attr.getAttributeName());
    switch(type) {
        case AGENDA_GROUP:
        case ACTIVATION_GROUP:
        case RULEFLOW_GROUP:
        case ENTRY_POINT:
            SharedPart sharedRef = new SharedPart(attr.getValue(), type);
            builder.addGenerator(sharedRef);
            break;
        // OCRAM: finish
        default:
    }
}
Also used : PartType(org.kie.workbench.common.services.refactoring.service.PartType) SharedPart(org.kie.workbench.common.services.refactoring.SharedPart)

Aggregations

SharedPart (org.kie.workbench.common.services.refactoring.SharedPart)3 PartType (org.kie.workbench.common.services.refactoring.service.PartType)2 Resource (org.kie.workbench.common.services.refactoring.Resource)1 ResourceReference (org.kie.workbench.common.services.refactoring.ResourceReference)1