use of org.opentosca.toscana.model.operation.StandardLifecycle in project TOSCAna by StuPro-TOSCAna.
the class NodeVisitor method getScripts.
private void getScripts(RootNode node, Application application) {
StandardLifecycle lifecycle = node.getStandardLifecycle();
Optional<Operation> configureOptional = lifecycle.getConfigure();
// get configure script
if (configureOptional.isPresent()) {
Optional<Artifact> configureArtifact = configureOptional.get().getArtifact();
configureArtifact.ifPresent(artifact -> application.addExecuteFile(artifact.getFilePath(), node));
}
// get create script
Optional<Operation> createOptional = lifecycle.getCreate();
if (createOptional.isPresent()) {
Optional<Artifact> createArtifact = createOptional.get().getArtifact();
createArtifact.ifPresent(artifact -> application.addExecuteFile(artifact.getFilePath(), node));
}
}
Aggregations