Search in sources :

Example 1 with GcpPubSubModelAugmentor

use of io.automatiko.engine.codegen.process.augmentors.GcpPubSubModelAugmentor 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;
}
Also used : WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess) GcpPubSubModelAugmentor(io.automatiko.engine.codegen.process.augmentors.GcpPubSubModelAugmentor) ModelMetaData(io.automatiko.engine.workflow.compiler.canonical.ModelMetaData) GraphQLModelAugmentor(io.automatiko.engine.codegen.process.augmentors.GraphQLModelAugmentor)

Example 2 with GcpPubSubModelAugmentor

use of io.automatiko.engine.codegen.process.augmentors.GcpPubSubModelAugmentor in project automatiko-engine by automatiko-io.

the class ModelClassGenerator method generate.

public ModelMetaData generate() {
    // create model class for all variables
    modelMetaData = execModelGenerator.generateModel(workFlowProcess);
    modelFileName = modelMetaData.getModelClassName().replace('.', '/') + ".java";
    modelMetaData.setSupportsValidation(context.getBuildContext().isValidationSupported());
    modelMetaData.setSupportsOpenApi(context.getBuildContext().isOpenApiSupported());
    modelMetaData.setAsEntity(context.getBuildContext().isEntitiesSupported(), context.getBuildContext().config().persistence().database().removeAtCompletion().orElse(false));
    if (context.getApplicationProperty("quarkus.automatiko.target-deployment").orElse("unknown").equals("gcp-pubsub")) {
        modelMetaData.addAugmentor(new GcpPubSubModelAugmentor());
    }
    return modelMetaData;
}
Also used : GcpPubSubModelAugmentor(io.automatiko.engine.codegen.process.augmentors.GcpPubSubModelAugmentor)

Aggregations

GcpPubSubModelAugmentor (io.automatiko.engine.codegen.process.augmentors.GcpPubSubModelAugmentor)2 WorkflowProcess (io.automatiko.engine.api.definition.process.WorkflowProcess)1 GraphQLModelAugmentor (io.automatiko.engine.codegen.process.augmentors.GraphQLModelAugmentor)1 ModelMetaData (io.automatiko.engine.workflow.compiler.canonical.ModelMetaData)1