Search in sources :

Example 1 with PartType

use of org.kie.workbench.common.services.refactoring.service.PartType 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 2 with PartType

use of org.kie.workbench.common.services.refactoring.service.PartType 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)2 PartType (org.kie.workbench.common.services.refactoring.service.PartType)2