|
a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java |
|
b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java |
|
... |
|
... |
163 |
private IFolder relationsFolder;
|
163 |
private IFolder relationsFolder;
|
164 |
|
164 |
|
165 |
/*
|
165 |
/*
|
166 |
* // PROPERTIES & ARGUMENTS //////////////
|
166 |
* // PROPERTIES & ARGUMENTS //////////////
|
167 |
*/
|
167 |
*/
|
168 |
private static Path archimateOutputPath;
|
168 |
private Path archimateOutputPath;
|
169 |
private static Path inputFileName;
|
169 |
private Path inputFileName;
|
170 |
private static Path dotLocation;
|
170 |
private Path dotLocation;
|
171 |
private static Path tavernaHome;
|
171 |
private Path tavernaHome;
|
172 |
private static Path tavernaHomeLib;
|
172 |
private Path tavernaHomeLib;
|
173 |
private static Path tavernaHomeRepo;
|
173 |
private Path tavernaHomeRepo;
|
|
|
174 |
private boolean addDepsJar;
|
|
|
175 |
private Path repoLocation;
|
174 |
|
176 |
|
175 |
private List<IArchimateElement> nodeElements;
|
177 |
private List<IArchimateElement> nodeElements;
|
176 |
//private static Logger LOGGER = LogManager.getLogger("TavernaExtractor");
|
178 |
//private static Logger LOGGER = LogManager.getLogger("TavernaExtractor");
|
177 |
private LicenseCheck licenseCheck = new LicenseCheck();
|
179 |
private LicenseCheck licenseCheck = new LicenseCheck();
|
178 |
private IArtifact workflowFile;
|
180 |
private IArtifact workflowFile;
|
|
... |
|
... |
208 |
}
|
210 |
}
|
209 |
|
211 |
|
210 |
/*
|
212 |
/*
|
211 |
* // GETTER & SETTER ///////////////
|
213 |
* // GETTER & SETTER ///////////////
|
212 |
*/
|
214 |
*/
|
|
|
215 |
|
|
|
216 |
public void shouldAddDepJars(String pathToTavernaLocation) {
|
|
|
217 |
this.addDepsJar = true;
|
|
|
218 |
repoLocation = Paths.get(pathToTavernaLocation);
|
|
|
219 |
}
|
|
|
220 |
|
213 |
public void setDotLocation(Path dotLocation) {
|
221 |
public void setDotLocation(Path dotLocation) {
|
214 |
TavernaExtractor.dotLocation = dotLocation;
|
222 |
this.dotLocation = dotLocation;
|
215 |
}
|
223 |
}
|
216 |
|
224 |
|
217 |
public Path getDotLocation() {
|
225 |
public Path getDotLocation() {
|
218 |
return dotLocation;
|
226 |
return dotLocation;
|
219 |
}
|
227 |
}
|
|
... |
|
... |
221 |
public Path getArchimateOutputPath() {
|
229 |
public Path getArchimateOutputPath() {
|
222 |
return archimateOutputPath;
|
230 |
return archimateOutputPath;
|
223 |
}
|
231 |
}
|
224 |
|
232 |
|
225 |
public void setArchimateOutputPath(Path archimateOutputPath) {
|
233 |
public void setArchimateOutputPath(Path archimateOutputPath) {
|
226 |
TavernaExtractor.archimateOutputPath = archimateOutputPath;
|
234 |
this.archimateOutputPath = archimateOutputPath;
|
227 |
}
|
235 |
}
|
228 |
|
236 |
|
229 |
public Path getInputFileName() {
|
237 |
public Path getInputFileName() {
|
230 |
return inputFileName;
|
238 |
return inputFileName;
|
231 |
}
|
239 |
}
|
232 |
|
240 |
|
233 |
public void setInputFileName(Path inputFileName) {
|
241 |
public void setInputFileName(Path inputFileName) {
|
234 |
TavernaExtractor.inputFileName = inputFileName;
|
242 |
this.inputFileName = inputFileName;
|
235 |
}
|
243 |
}
|
236 |
|
244 |
|
237 |
public Path getTavernaHome() {
|
245 |
public Path getTavernaHome() {
|
238 |
return tavernaHome;
|
246 |
return tavernaHome;
|
239 |
}
|
247 |
}
|
240 |
|
248 |
|
241 |
public void setTavernaHome(Path tavernaHome) {
|
249 |
public void setTavernaHome(Path tavernaHome) {
|
242 |
|
|
|
243 |
TavernaExtractor.tavernaHome = tavernaHome;
|
250 |
this.tavernaHome = tavernaHome;
|
244 |
}
|
251 |
}
|
245 |
|
252 |
|
246 |
public Path getTavernaHomeLib() {
|
253 |
public Path getTavernaHomeLib() {
|
247 |
return tavernaHomeLib;
|
254 |
return tavernaHomeLib;
|
248 |
}
|
255 |
}
|
249 |
|
256 |
|
250 |
public void setTavernaHomeLib(Path tavernaHomeLib) {
|
257 |
public void setTavernaHomeLib(Path tavernaHomeLib) {
|
251 |
TavernaExtractor.tavernaHomeLib = tavernaHomeLib;
|
258 |
this.tavernaHomeLib = tavernaHomeLib;
|
252 |
}
|
259 |
}
|
253 |
|
260 |
|
254 |
public Path getTavernaHomeRepo() {
|
261 |
public Path getTavernaHomeRepo() {
|
255 |
return tavernaHomeRepo;
|
262 |
return tavernaHomeRepo;
|
256 |
}
|
263 |
}
|
257 |
|
264 |
|
258 |
public void setTavernaHomeRepo(Path tavernaHomeRepo) {
|
265 |
public void setTavernaHomeRepo(Path tavernaHomeRepo) {
|
259 |
TavernaExtractor.tavernaHomeRepo = tavernaHomeRepo;
|
266 |
this.tavernaHomeRepo = tavernaHomeRepo;
|
260 |
}
|
267 |
}
|
261 |
|
268 |
|
262 |
|
269 |
|
263 |
public List<IRelationship> getRelations() {
|
270 |
public List<IRelationship> getRelations() {
|
264 |
return this.relations;
|
271 |
return this.relations;
|
|
... |
|
... |
324 |
if (remote)
|
331 |
if (remote)
|
325 |
dataflow = getDataflowRemote();
|
332 |
dataflow = getDataflowRemote();
|
326 |
else
|
333 |
else
|
327 |
dataflow = getDataflowLocal();
|
334 |
dataflow = getDataflowLocal();
|
328 |
|
335 |
|
329 |
|
|
|
330 |
// current classpath
|
|
|
331 |
String classpath = System.getProperty("java.class.path");
|
|
|
332 |
String[] classpathEntries = classpath.split(File.pathSeparator);
|
|
|
333 |
List<String> cleanClasspathEntries = cleanedClasspath(Arrays.asList(classpathEntries));
|
|
|
334 |
|
|
|
335 |
factory = IArchimateFactory.eINSTANCE;
|
336 |
factory = IArchimateFactory.eINSTANCE;
|
336 |
|
337 |
|
337 |
IArchimateModel model = factory.createArchimateModel();
|
338 |
IArchimateModel model = factory.createArchimateModel();
|
338 |
model.setDefaults();
|
339 |
model.setDefaults();
|
339 |
model.setName("Converted Taverna Workflow " + inputFileName);
|
340 |
model.setName("Converted Taverna Workflow " + inputFileName);
|
|
... |
|
... |
411 |
|
412 |
|
412 |
ArchiUtils.initRelation(factory.createRealisationRelationship(), taverna, workflowApplicationComponent,
|
413 |
ArchiUtils.initRelation(factory.createRealisationRelationship(), taverna, workflowApplicationComponent,
|
413 |
relationsFolder, relations);
|
414 |
relationsFolder, relations);
|
414 |
|
415 |
|
415 |
// add dependable Taverna jars from classpath
|
416 |
// add dependable Taverna jars from classpath
|
|
|
417 |
// only if -a argument is present
|
|
|
418 |
if (addDepsJar) {
|
|
|
419 |
|
|
|
420 |
LOGGER.info("add taverna jar dependencies to processModel");
|
|
|
421 |
|
|
|
422 |
// current classpath
|
|
|
423 |
// String classpath = System.getProperty("java.class.path");
|
|
|
424 |
// String[] classpathEntries = classpath.split(File.pathSeparator);
|
|
|
425 |
// List<String> cleanClasspathEntries = cleanedClasspath(Arrays.asList(classpathEntries));
|
|
|
426 |
//
|
416 |
for (String jar : cleanClasspathEntries) {
|
427 |
// for (String jar : cleanClasspathEntries) {
|
417 |
taverna.getProperties().add(createDepProperties(jar));
|
428 |
// taverna.getProperties().add(createDepProperties(jar));
|
418 |
}
|
429 |
// }
|
419 |
|
430 |
|
420 |
// link relevant dependencies from taverna home to context model
|
431 |
// link relevant dependencies from taverna home to context model
|
421 |
IArtifact repoBundle = (IArtifact) ArchiUtils.initElement(factory.createArtifact(), "Repo Bundle", infrastructureFolder, nodeElements);
|
432 |
IArtifact repoBundle = (IArtifact) ArchiUtils.initElement(factory.createArtifact(), "Repo Bundle", infrastructureFolder, nodeElements);
|
422 |
ArchiUtils.initRelation(factory.createAssociationRelationship(), taverna, repoBundle,
|
433 |
ArchiUtils.initRelation(factory.createAssociationRelationship(), taverna, repoBundle,
|
423 |
relationsFolder, relations);
|
434 |
relationsFolder, relations);
|
424 |
|
435 |
|
425 |
ArchiUtils.initRelation(factory.createCompositionRelationship(), desktop, repoBundle,
|
436 |
ArchiUtils.initRelation(factory.createCompositionRelationship(), desktop, repoBundle,
|
426 |
relationsFolder, relations);
|
437 |
relationsFolder, relations);
|
427 |
|
438 |
|
428 |
if (this.getTavernaHomeRepo().toFile().isDirectory()) {
|
439 |
if (repoLocation.toFile().isDirectory()) {
|
429 |
|
440 |
|
430 |
final List<File> jarFiles = new ArrayList<>();
|
441 |
final List<File> jarFiles = new ArrayList<>();
|
431 |
final PathMatcher matcher = FileSystems.getDefault()
|
442 |
final PathMatcher matcher = FileSystems.getDefault()
|
432 |
.getPathMatcher("glob:*.jar");
|
443 |
.getPathMatcher("glob:*.jar");
|
433 |
Files.walkFileTree(this.getTavernaHomeRepo(), new FileVisitor<Path>() {
|
444 |
Files.walkFileTree(repoLocation, new FileVisitor<Path>() {
|
434 |
@Override
|
445 |
@Override
|
435 |
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes basicFileAttributes) throws IOException {
|
446 |
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes basicFileAttributes) throws IOException {
|
436 |
return CONTINUE;
|
447 |
return CONTINUE;
|
|
|
448 |
}
|
|
|
449 |
|
|
|
450 |
@Override
|
|
|
451 |
public FileVisitResult visitFile(Path path, BasicFileAttributes basicFileAttributes) throws IOException {
|
|
|
452 |
|
|
|
453 |
if (path != null && matcher.matches(path.getFileName())) {
|
|
|
454 |
jarFiles.add(path.toFile());
|
|
|
455 |
}
|
|
|
456 |
return CONTINUE;
|
|
|
457 |
}
|
|
|
458 |
|
|
|
459 |
@Override
|
|
|
460 |
public FileVisitResult visitFileFailed(Path path, IOException e) throws IOException {
|
|
|
461 |
return CONTINUE;
|
|
|
462 |
}
|
|
|
463 |
|
|
|
464 |
@Override
|
|
|
465 |
public FileVisitResult postVisitDirectory(Path path, IOException e) throws IOException {
|
|
|
466 |
return CONTINUE;
|
|
|
467 |
}
|
|
|
468 |
});
|
|
|
469 |
|
|
|
470 |
for (File jarDep : jarFiles) {
|
|
|
471 |
String jarLocation = jarDep.getAbsolutePath();
|
|
|
472 |
LOGGER.debug("Add "+jarLocation+" dependency to repo bundle");
|
|
|
473 |
repoBundle.getProperties().add(createDepProperties(jarLocation));
|
437 |
}
|
474 |
}
|
438 |
|
475 |
} else {
|
439 |
@Override
|
476 |
LOGGER.error("ERROR: " + repoLocation.toFile() + " is not a directory. No further dependencies processing.");
|
440 |
public FileVisitResult visitFile(Path path, BasicFileAttributes basicFileAttributes) throws IOException {
|
|
|
441 |
|
|
|
442 |
if (path != null && matcher.matches(path.getFileName())) {
|
|
|
443 |
jarFiles.add(path.toFile());
|
|
|
444 |
}
|
|
|
445 |
return CONTINUE;
|
|
|
446 |
}
|
|
|
447 |
|
|
|
448 |
@Override
|
|
|
449 |
public FileVisitResult visitFileFailed(Path path, IOException e) throws IOException {
|
|
|
450 |
return CONTINUE;
|
|
|
451 |
}
|
|
|
452 |
|
|
|
453 |
@Override
|
|
|
454 |
public FileVisitResult postVisitDirectory(Path path, IOException e) throws IOException {
|
|
|
455 |
return CONTINUE;
|
|
|
456 |
}
|
|
|
457 |
});
|
477 |
}
|
458 |
|
|
|
459 |
for (File jarDep : jarFiles) {
|
|
|
460 |
String jarLocation = jarDep.getAbsolutePath();
|
|
|
461 |
repoBundle.getProperties().add(createDepProperties(jarLocation));
|
|
|
462 |
}
|
|
|
463 |
} else {
|
|
|
464 |
LOGGER.error("ERROR: " + this.getTavernaHomeRepo().toFile() + " is not a directory. No further dependecies processing.");
|
|
|
465 |
}
|
478 |
}
|
466 |
// --- END Taverna ---
|
479 |
// --- END Taverna ---
|
467 |
|
480 |
|
468 |
// --- BEGIN Events ---
|
481 |
// --- BEGIN Events ---
|
469 |
// Start Event
|
482 |
// Start Event
|
|
... |
|
... |
659 |
applicationFolder, externalApplicationServices);
|
672 |
applicationFolder, externalApplicationServices);
|
660 |
|
673 |
|
661 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(), processorName
|
674 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(), processorName
|
662 |
+ "Service", applicationFolder, externalApplicationServices);
|
675 |
+ "Service", applicationFolder, externalApplicationServices);
|
663 |
|
676 |
|
664 |
appService.getProperties().add(locationProp);
|
677 |
//appService.getProperties().add(locationProp);
|
665 |
|
678 |
|
666 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
679 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
667 |
relationsFolder, relations);
|
680 |
relationsFolder, relations);
|
668 |
|
681 |
|
669 |
// used-by relation between business processor and application function
|
682 |
// used-by relation between business processor and application function
|
|
... |
|
... |
743 |
|
756 |
|
744 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(), processorName
|
757 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(), processorName
|
745 |
+ "Service", applicationFolder, externalApplicationServices);
|
758 |
+ "Service", applicationFolder, externalApplicationServices);
|
746 |
|
759 |
|
747 |
|
760 |
|
748 |
appService.getProperties().add(createDepProperties(RshellActivity.class));
|
761 |
//appService.getProperties().add(createDepProperties(RshellActivity.class));
|
749 |
|
762 |
|
750 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
763 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
751 |
relationsFolder, relations);
|
764 |
relationsFolder, relations);
|
752 |
|
765 |
|
753 |
// used-by relation between business processor and application function
|
766 |
// used-by relation between business processor and application function
|
|
... |
|
... |
839 |
IApplicationService appService = isExternal ? ArchiUtils.initElement(factory.createApplicationService(),
|
852 |
IApplicationService appService = isExternal ? ArchiUtils.initElement(factory.createApplicationService(),
|
840 |
processorName + "Service", applicationFolder, externalApplicationServices) : ArchiUtils
|
853 |
processorName + "Service", applicationFolder, externalApplicationServices) : ArchiUtils
|
841 |
.initElement(factory.createApplicationService(), processorName + "Service", applicationFolder,
|
854 |
.initElement(factory.createApplicationService(), processorName + "Service", applicationFolder,
|
842 |
applicationComponents);
|
855 |
applicationComponents);
|
843 |
|
856 |
|
844 |
appService.getProperties().add(createDepProperties(ExternalToolActivity.class));
|
857 |
//appService.getProperties().add(createDepProperties(ExternalToolActivity.class));
|
845 |
|
858 |
|
846 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
859 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
847 |
relationsFolder, relations);
|
860 |
relationsFolder, relations);
|
848 |
|
861 |
|
849 |
// used-by relation between business processor and application function
|
862 |
// used-by relation between business processor and application function
|
|
... |
|
... |
944 |
}
|
957 |
}
|
945 |
|
958 |
|
946 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
959 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
947 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
960 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
948 |
|
961 |
|
949 |
appService.getProperties().add(createDepProperties(XMLInputSplitterActivity.class));
|
962 |
//appService.getProperties().add(createDepProperties(XMLInputSplitterActivity.class));
|
950 |
|
963 |
|
951 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
964 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
952 |
relationsFolder, relations);
|
965 |
relationsFolder, relations);
|
953 |
|
966 |
|
954 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callXMLSplitterApplicationFunction,
|
967 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callXMLSplitterApplicationFunction,
|
955 |
processorProcessMap.get(processor), relationsFolder, relations);
|
968 |
processorProcessMap.get(processor), relationsFolder, relations);
|
956 |
|
969 |
|
957 |
LOGGER.debug("Get input elements of process "+ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
970 |
LOGGER.debug("Get input elements of process " + ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
958 |
relations).size());
|
971 |
relations).size());
|
959 |
// creating request response data objects
|
972 |
// creating request response data objects
|
960 |
for (IArchimateElement inputElement : ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
973 |
for (IArchimateElement inputElement : ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
961 |
relations)) {
|
974 |
relations)) {
|
962 |
|
975 |
|
963 |
LOGGER.debug("inputElement = "+inputElement.getName());
|
976 |
LOGGER.debug("inputElement = " + inputElement.getName());
|
964 |
|
977 |
|
965 |
if (!business2dataMap.containsKey(inputElement)) {
|
978 |
if (!business2dataMap.containsKey(inputElement)) {
|
966 |
|
979 |
|
967 |
IDataObject requestObject = ArchiUtils.initElement(factory.createDataObject(), inputElement.getName(),
|
980 |
IDataObject requestObject = ArchiUtils.initElement(factory.createDataObject(), inputElement.getName(),
|
968 |
applicationFolder, applicationComponents);
|
981 |
applicationFolder, applicationComponents);
|
|
... |
|
... |
975 |
ArchiUtils.initAccessRelation(factory.createAccessRelationship(), appService,
|
988 |
ArchiUtils.initAccessRelation(factory.createAccessRelationship(), appService,
|
976 |
business2dataMap.get(inputElement), applicationFolder, relations, IAccessRelationship.READ_ACCESS);
|
989 |
business2dataMap.get(inputElement), applicationFolder, relations, IAccessRelationship.READ_ACCESS);
|
977 |
|
990 |
|
978 |
}
|
991 |
}
|
979 |
|
992 |
|
980 |
LOGGER.debug("Get output elements of process "+ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
993 |
LOGGER.debug("Get output elements of process " + ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
981 |
relations).size());
|
994 |
relations).size());
|
982 |
for (IArchimateElement outputElement : ArchiUtils.getOutputElementsOfProcess(
|
995 |
for (IArchimateElement outputElement : ArchiUtils.getOutputElementsOfProcess(
|
983 |
processorProcessMap.get(processor), relations)) {
|
996 |
processorProcessMap.get(processor), relations)) {
|
984 |
|
997 |
|
985 |
LOGGER.debug("inputElement = "+outputElement.getName());
|
998 |
LOGGER.debug("inputElement = " + outputElement.getName());
|
986 |
|
999 |
|
987 |
if (!business2dataMap.containsKey(outputElement)) {
|
1000 |
if (!business2dataMap.containsKey(outputElement)) {
|
988 |
|
1001 |
|
989 |
IDataObject responseObject = ArchiUtils.initElement(factory.createDataObject(),
|
1002 |
IDataObject responseObject = ArchiUtils.initElement(factory.createDataObject(),
|
990 |
outputElement.getName(), applicationFolder, applicationComponents);
|
1003 |
outputElement.getName(), applicationFolder, applicationComponents);
|
|
... |
|
... |
1002 |
|
1015 |
|
1003 |
}
|
1016 |
}
|
1004 |
}
|
1017 |
}
|
1005 |
|
1018 |
|
1006 |
public void processXPathActivity(IFolder infrastructureFolder, IFolder motivationFolder,
|
1019 |
public void processXPathActivity(IFolder infrastructureFolder, IFolder motivationFolder,
|
1007 |
IFolder applicationFolder, IFolder relationsFolder, IApplicationComponent workflowApplicationComponent,
|
1020 |
IFolder applicationFolder, IFolder relationsFolder, IApplicationComponent workflowApplicationComponent,
|
1008 |
HashMap<Processor, IBusinessProcess> processorProcessMap, Processor processor, Activity<?> a)
|
1021 |
HashMap<Processor, IBusinessProcess> processorProcessMap, Processor processor, Activity<?> a)
|
1009 |
throws IOException {
|
1022 |
throws IOException {
|
1010 |
|
1023 |
|
1011 |
//beanshellScripts.add((BeanshellActivity) a);
|
1024 |
//beanshellScripts.add((BeanshellActivity) a);
|
1012 |
|
1025 |
|
1013 |
LOGGER.debug("XPath script found = " + processor.getLocalName());
|
1026 |
LOGGER.debug("XPath script found = " + processor.getLocalName());
|
|
... |
|
... |
1028 |
}
|
1041 |
}
|
1029 |
|
1042 |
|
1030 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
1043 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
1031 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
1044 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
1032 |
|
1045 |
|
1033 |
appService.getProperties().add(createDepProperties(BeanshellActivity.class));
|
1046 |
//appService.getProperties().add(createDepProperties(BeanshellActivity.class));
|
1034 |
|
1047 |
|
1035 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
1048 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
1036 |
relationsFolder, relations);
|
1049 |
relationsFolder, relations);
|
1037 |
|
1050 |
|
1038 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callXPathApplicationFunction,
|
1051 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callXPathApplicationFunction,
|
1039 |
processorProcessMap.get(processor), relationsFolder, relations);
|
1052 |
processorProcessMap.get(processor), relationsFolder, relations);
|
1040 |
|
1053 |
|
1041 |
IArtifact script = (IArtifact) ArchiUtils.initElement(factory.createArtifact(), processor.getLocalName()
|
1054 |
IArtifact script = (IArtifact) ArchiUtils.initElement(factory.createArtifact(), processor.getLocalName()
|
1042 |
, infrastructureFolder, nodeElements);
|
1055 |
, infrastructureFolder, nodeElements);
|
1043 |
|
1056 |
|
1044 |
XPathActivityConfigurationBean c = (XPathActivityConfigurationBean) a.getConfiguration();
|
1057 |
XPathActivityConfigurationBean c = (XPathActivityConfigurationBean) a.getConfiguration();
|
1045 |
String ex = c.getXpathExpression() != null ? c.getXpathExpression() : "NO_EXPRESSION_AVAILABLE";
|
1058 |
String ex = c.getXpathExpression() != null ? c.getXpathExpression() : "NO_EXPRESSION_AVAILABLE";
|
1046 |
String doc = c.getXmlDocument() != null ? c.getXmlDocument() : "NO_XML_DOCUMENT_AVAILABLE";
|
1059 |
String doc = c.getXmlDocument() != null ? c.getXmlDocument() : "NO_XML_DOCUMENT_AVAILABLE";
|
1047 |
|
1060 |
|
1048 |
IProperty property = factory.createProperty();
|
1061 |
IProperty property = factory.createProperty();
|
1049 |
property.setKey("expression");
|
1062 |
property.setKey("expression");
|
1050 |
property.setValue(ex);
|
1063 |
property.setValue(ex);
|
1051 |
script.getProperties().add(property);
|
1064 |
script.getProperties().add(property);
|
1052 |
|
1065 |
|
1053 |
IProperty property_document = factory.createProperty();
|
1066 |
IProperty property_document = factory.createProperty();
|
1054 |
property_document.setKey("document");
|
1067 |
property_document.setKey("document");
|
1055 |
property_document.setValue(doc);
|
1068 |
property_document.setValue(doc);
|
1056 |
script.getProperties().add(property_document);
|
1069 |
script.getProperties().add(property_document);
|
1057 |
|
1070 |
|
1058 |
ArchiUtils.initRelation(factory.createCompositionRelationship(), workflowFile, script, relationsFolder,
|
1071 |
ArchiUtils.initRelation(factory.createCompositionRelationship(), workflowFile, script, relationsFolder,
|
1059 |
relations);
|
1072 |
relations);
|
1060 |
|
1073 |
|
1061 |
ArchiUtils
|
1074 |
ArchiUtils
|
1062 |
.initRelation(factory.createRealisationRelationship(), script, appService, relationsFolder, relations);
|
1075 |
.initRelation(factory.createRealisationRelationship(), script, appService, relationsFolder, relations);
|
1063 |
|
1076 |
|
1064 |
// creating request response data objects
|
1077 |
// creating request response data objects
|
1065 |
for (IArchimateElement inputElement : ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
1078 |
for (IArchimateElement inputElement : ArchiUtils.getInputElementsOfProcess(processorProcessMap.get(processor),
|
1066 |
relations)) {
|
1079 |
relations)) {
|
|
... |
|
... |
1124 |
}
|
1137 |
}
|
1125 |
|
1138 |
|
1126 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
1139 |
IApplicationService appService = ArchiUtils.initElement(factory.createApplicationService(),
|
1127 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
1140 |
processor.getLocalName(), applicationFolder, externalApplicationServices);
|
1128 |
|
1141 |
|
1129 |
appService.getProperties().add(createDepProperties(BeanshellActivity.class));
|
1142 |
//appService.getProperties().add(createDepProperties(BeanshellActivity.class));
|
1130 |
|
1143 |
|
1131 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
1144 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), appService, processorProcessMap.get(processor),
|
1132 |
relationsFolder, relations);
|
1145 |
relationsFolder, relations);
|
1133 |
|
1146 |
|
1134 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callScriptApplicationFunction,
|
1147 |
ArchiUtils.initRelation(factory.createUsedByRelationship(), callScriptApplicationFunction,
|
|
... |
|
... |
1865 |
List<Processor> startingProcessors = new ArrayList<Processor>();
|
1878 |
List<Processor> startingProcessors = new ArrayList<Processor>();
|
1866 |
for (Processor processor : dataflow.getProcessors()) {
|
1879 |
for (Processor processor : dataflow.getProcessors()) {
|
1867 |
|
1880 |
|
1868 |
if (ArchiUtils.isValueProcessor(processor)) {
|
1881 |
if (ArchiUtils.isValueProcessor(processor)) {
|
1869 |
break;
|
1882 |
break;
|
1870 |
}
|
|
|
1871 |
else{
|
1883 |
} else {
|
1872 |
startingProcessors.add(processor);
|
1884 |
startingProcessors.add(processor);
|
1873 |
}
|
1885 |
}
|
1874 |
}
|
1886 |
}
|
1875 |
if(startingProcessors.size() == 1){
|
1887 |
if (startingProcessors.size() == 1) {
|
1876 |
return startingProcessors;
|
1888 |
return startingProcessors;
|
1877 |
}
|
1889 |
}
|
1878 |
|
1890 |
|
1879 |
startingProcessors = new ArrayList<Processor>();
|
1891 |
startingProcessors = new ArrayList<Processor>();
|
1880 |
for (Processor processor : dataflow.getProcessors()) {
|
1892 |
for (Processor processor : dataflow.getProcessors()) {
|
|
... |
|
... |
2146 |
// disabled
|
2158 |
// disabled
|
2147 |
else if (a instanceof WSDLActivity) {
|
2159 |
else if (a instanceof WSDLActivity) {
|
2148 |
processWebServiceActivity(businessFolder, infrastructureFolder, applicationFolder, relationsFolder,
|
2160 |
processWebServiceActivity(businessFolder, infrastructureFolder, applicationFolder, relationsFolder,
|
2149 |
workflowApplicationComponent, processorProcessMap, callWebServiceApplicationFunction,
|
2161 |
workflowApplicationComponent, processorProcessMap, callWebServiceApplicationFunction,
|
2150 |
processor, processorName, a);
|
2162 |
processor, processorName, a);
|
2151 |
}
|
|
|
2152 |
else if (a instanceof XMLInputSplitterActivity || a instanceof XMLOutputSplitterActivity) {
|
2163 |
} else if (a instanceof XMLInputSplitterActivity || a instanceof XMLOutputSplitterActivity) {
|
2153 |
processXMLSplitterActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2164 |
processXMLSplitterActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2154 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2165 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2155 |
}
|
|
|
2156 |
else if (a instanceof XPathActivity){
|
2166 |
} else if (a instanceof XPathActivity) {
|
2157 |
LOGGER.info("XPathActivity has to be done");
|
2167 |
LOGGER.info("XPathActivity has to be done");
|
2158 |
processXPathActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2168 |
processXPathActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2159 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2169 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2160 |
}
|
|
|
2161 |
else if (a instanceof LocalworkerActivity){
|
2170 |
} else if (a instanceof LocalworkerActivity) {
|
2162 |
|
2171 |
|
2163 |
/*
|
2172 |
/*
|
2164 |
Localworker Activity equals BeanshellActivity ?!
|
2173 |
Localworker Activity equals BeanshellActivity ?!
|
2165 |
*/
|
2174 |
*/
|
2166 |
processBeanshellActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2175 |
processBeanshellActivity(infrastructureFolder, motivationFolder, applicationFolder,
|
2167 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2176 |
relationsFolder, workflowApplicationComponent, processorProcessMap, processor, a);
|
2168 |
}
|
|
|
2169 |
else{
|
2177 |
} else {
|
2170 |
LOGGER.debug("Unfortunately, we do not process that kind of activity.");
|
2178 |
LOGGER.debug("Unfortunately, we do not process that kind of activity.");
|
2171 |
}
|
2179 |
}
|
2172 |
}
|
2180 |
}
|
2173 |
}
|
2181 |
}
|
2174 |
}
|
2182 |
}
|
|
... |
|
... |
2209 |
public void treatProcessors(List<? extends Processor> processors) {
|
2217 |
public void treatProcessors(List<? extends Processor> processors) {
|
2210 |
|
2218 |
|
2211 |
for (Processor processor : dataflow.getProcessors()) {
|
2219 |
for (Processor processor : dataflow.getProcessors()) {
|
2212 |
IArchimateElement archimateElement = null;
|
2220 |
IArchimateElement archimateElement = null;
|
2213 |
|
2221 |
|
2214 |
LOGGER.debug("Treat processor "+processor.getLocalName());
|
2222 |
LOGGER.debug("Treat processor " + processor.getLocalName());
|
2215 |
|
2223 |
|
2216 |
// "value" processors are actually a constant input port, treat them special
|
2224 |
// "value" processors are actually a constant input port, treat them special
|
2217 |
if (ArchiUtils.isValueProcessor(processor)) {
|
2225 |
if (ArchiUtils.isValueProcessor(processor)) {
|
2218 |
IBusinessObject valueBusinessObject = ArchiUtils.initElement(factory.createBusinessObject(),
|
2226 |
IBusinessObject valueBusinessObject = ArchiUtils.initElement(factory.createBusinessObject(),
|
2219 |
processor.getLocalName(), businessFolder, valueObjects);
|
2227 |
processor.getLocalName(), businessFolder, valueObjects);
|