use of org.drools.core.definitions.ProcessPackage in project drools by kiegroup.
the class KnowledgePackageImpl method removeRuleFlow.
/**
* Rule flows can be removed by ID.
*/
public void removeRuleFlow(String id) {
ProcessPackage rtp = (ProcessPackage) getResourceTypePackages().get(ResourceType.BPMN2);
if (rtp == null || rtp.lookup(id) == null) {
throw new IllegalArgumentException("The rule flow with id [" + id + "] is not part of this package.");
}
rtp.remove(id);
}
use of org.drools.core.definitions.ProcessPackage in project drools by kiegroup.
the class KnowledgePackageImpl method addProcess.
/**
* Add a rule flow to this package.
*/
public void addProcess(Process process) {
ResourceTypePackageRegistry rtps = getResourceTypePackages();
ProcessPackage rtp = ProcessPackage.getOrCreate(rtps);
rtp.add(process);
}
use of org.drools.core.definitions.ProcessPackage in project drools by kiegroup.
the class KnowledgePackageImpl method getProcessesGeneratedFromResource.
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;
}
Aggregations