use of io.automatiko.engine.codegen.process.augmentors.GraphQLModelAugmentor in project automatiko-engine by automatiko-io.
the class InputModelClassGenerator method generate.
public ModelMetaData generate() {
// create model class for all variables
String packageName = workFlowProcess.getPackageName();
modelMetaData = new ModelMetaData(workflowType, workFlowProcess.getId(), CodegenUtils.version(workFlowProcess.getVersion()), packageName, className, workFlowProcess.getVisibility(), VariableDeclarations.ofInput((VariableScope) ((io.automatiko.engine.workflow.base.core.Process) workFlowProcess).getDefaultContext(VariableScope.VARIABLE_SCOPE)), true, ProcessToExecModelGenerator.isServerlessWorkflow(workFlowProcess) ? "/class-templates/JsonModelTemplate.java" : "/class-templates/ModelNoIDTemplate.java", "Input data model for " + workFlowProcess.getName(), "Describes input data model expected by " + workFlowProcess.getName());
modelMetaData.setSupportsValidation(context.getBuildContext().isValidationSupported());
modelMetaData.setSupportsOpenApi(context.getBuildContext().isOpenApiSupported());
if (context.getApplicationProperty("quarkus.automatiko.target-deployment").orElse("unknown").equals("gcp-pubsub")) {
modelMetaData.addAugmentor(new GcpPubSubModelAugmentor());
}
if (context.getBuildContext().isGraphQLSupported()) {
modelMetaData.addAugmentor(new GraphQLModelAugmentor(true, null, context));
}
modelFileName = modelMetaData.getModelClassName().replace('.', '/') + ".java";
return modelMetaData;
}
use of io.automatiko.engine.codegen.process.augmentors.GraphQLModelAugmentor in project automatiko-engine by automatiko-io.
the class OutputModelClassGenerator method generate.
public ModelMetaData generate() {
// create model class for all variables
String packageName = workFlowProcess.getPackageName();
modelMetaData = new ModelMetaData(workflowType, workFlowProcess.getId(), CodegenUtils.version(workFlowProcess.getVersion()), packageName, className, workFlowProcess.getVisibility(), VariableDeclarations.ofOutput((VariableScope) ((io.automatiko.engine.workflow.base.core.Process) workFlowProcess).getDefaultContext(VariableScope.VARIABLE_SCOPE)), true, ProcessToExecModelGenerator.isServerlessWorkflow(workFlowProcess) ? "/class-templates/JsonOutputModelTemplate.java" : "/class-templates/ModelTemplate.java", "Output data model for " + workFlowProcess.getName(), "Describes output data model expected by " + workFlowProcess.getName());
modelFileName = modelMetaData.getModelClassName().replace('.', '/') + ".java";
modelMetaData.setSupportsValidation(context.getBuildContext().isValidationSupported());
modelMetaData.setSupportsOpenApi(context.getBuildContext().isOpenApiSupported());
if (context.getBuildContext().isGraphQLSupported()) {
String processId = workFlowProcess.getId();
if (workFlowProcess.getVersion() != null) {
processId += "_" + workFlowProcess.getVersion();
}
modelMetaData.addAugmentor(new GraphQLModelAugmentor(false, context.getProcess(processId), context));
}
return modelMetaData;
}
Aggregations