use of org.kie.workbench.common.forms.migration.tool.bpmn.BPMNProcess in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorForBPMNWithComplexVariableTest method getProcessFormModels.
@Override
protected List<JBPMFormModel> getProcessFormModels() {
BPMNAnalyzer analyzer = new BPMNAnalyzer();
BPMNProcess process = analyzer.read(this.getClass().getResourceAsStream(BPMN_RESOURCES + INVOICES_BPMN));
return process.getFormModels();
}
use of org.kie.workbench.common.forms.migration.tool.bpmn.BPMNProcess in project kie-wb-common by kiegroup.
the class BPMNFormAdapter method readWorkspaceBPMNModels.
protected void readWorkspaceBPMNModels() {
BPMNAnalyzer analyzer = new BPMNAnalyzer();
Files.walkFileTree(Paths.convert(migrationContext.getWorkspaceProject().getRootPath()), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(org.uberfire.java.nio.file.Path visitedPath, BasicFileAttributes attrs) throws IOException {
org.uberfire.backend.vfs.Path visitedVFSPath = Paths.convert(visitedPath);
String fileName = visitedVFSPath.getFileName();
File file = visitedPath.toFile();
if (file.isFile()) {
if (fileName.endsWith("." + FormsMigrationConstants.BPMN_EXTENSION) || fileName.endsWith("." + FormsMigrationConstants.BPMN2_EXTENSION)) {
try {
BPMNProcess process = analyzer.read(migrationContext.getCDIWrapper().getIOService().newInputStream(visitedPath));
if (process != null) {
workspaceBPMNFormModels.addAll(process.getFormModels());
} else {
migrationContext.getSystem().console().format(FormsMigrationConstants.BPMN_PARSING_ERROR, FormsMigrationConstants.WARNING, fileName);
}
} catch (Exception ex) {
migrationContext.getSystem().console().format(FormsMigrationConstants.BPMN_PARSING_ERROR, FormsMigrationConstants.WARNING, fileName);
}
}
}
return FileVisitResult.CONTINUE;
}
});
}
use of org.kie.workbench.common.forms.migration.tool.bpmn.BPMNProcess in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorForBPMNForWrongTaskFormNameTest method getProcessFormModels.
@Override
protected List<JBPMFormModel> getProcessFormModels() {
BPMNAnalyzer analyzer = new BPMNAnalyzer();
BPMNProcess process = analyzer.read(this.getClass().getResourceAsStream(BPMN_RESOURCES + INVOICES_BPMN));
return process.getFormModels();
}
Aggregations