Java Code Examples for org.kie.api.io.Resource#equals()

The following examples show how to use org.kie.api.io.Resource#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackageDescr.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private <T extends BaseDescr> void removeObjectsGeneratedFromResource(Resource resource, Collection<T> descrs) {
    Iterator<T> i = descrs.iterator();
    while (i.hasNext()) {
        if (resource.equals(i.next().getResource())) {
            i.remove();
        }
    }
}
 
Example 2
Source File: KnowledgePackageImpl.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
public List<RuleImpl> getRulesGeneratedFromResource(Resource resource) {
    List<RuleImpl> rulesFromResource = new ArrayList<>();
    for (RuleImpl rule : rules.values()) {
        if (resource.equals(rule.getResource())) {
            rulesFromResource.add(rule);
        }
    }
    return rulesFromResource;
}
 
Example 3
Source File: KnowledgePackageImpl.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private List<TypeDeclaration> getTypesGeneratedFromResource(Resource resource) {
    List<TypeDeclaration> typesFromResource = new ArrayList<>();
    for (TypeDeclaration type : typeDeclarations.values()) {
        if (resource.equals(type.getResource())) {
            typesFromResource.add(type);
        }
    }
    return typesFromResource;
}
 
Example 4
Source File: KnowledgePackageImpl.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private List<Function> getFunctionsGeneratedFromResource(Resource resource) {
    List<Function> functionsFromResource = new ArrayList<>();
    for (Function function : functions.values()) {
        if (resource.equals(function.getResource())) {
            functionsFromResource.add(function);
        }
    }
    return functionsFromResource;
}
 
Example 5
Source File: KnowledgePackageImpl.java    From kogito-runtimes with Apache License 2.0 5 votes vote down vote up
private List<Process> getProcessesGeneratedFromResource(Resource resource) {
    ProcessPackage rtp = (ProcessPackage) getResourceTypePackages().get(ResourceType.BPMN2);
    if (rtp == null) {
        return Collections.emptyList();
    }
    List<Process> processesFromResource = new ArrayList<>();
    for (Process process : rtp) {
        if (resource.equals(process.getResource())) {
            processesFromResource.add(process);
        }
    }
    return processesFromResource;
}