Search in sources :

Example 1 with OpenApiTaskDescriptor

use of org.jbpm.compiler.canonical.descriptors.OpenApiTaskDescriptor in project kogito-runtimes by kiegroup.

the class OpenApiClientWorkItemIntrospector method introspect.

public void introspect(KogitoWorkflowProcess workFlowProcess) {
    final List<Node> nodes = workFlowProcess.getNodesRecursively();
    if (nodes == null || nodes.isEmpty()) {
        return;
    }
    nodes.stream().filter(OpenApiTaskDescriptor::isOpenApiTask).forEach(node -> {
        final OpenApiTaskDescriptor.WorkItemModifier modifier = OpenApiTaskDescriptor.modifierFor((WorkItemNode) node);
        final OpenApiClientOperation operation = discoverOperation(modifier.getInterface(), modifier.getOperation());
        modifier.modify(operation.getGeneratedClass(), operation.getMethodName(), operation.getParameters().stream().sorted().map(OpenApiClientOperation.Parameter::getSpecParameter).collect(Collectors.toList()));
    });
}
Also used : OpenApiTaskDescriptor(org.jbpm.compiler.canonical.descriptors.OpenApiTaskDescriptor) OpenApiClientOperation(org.kie.kogito.codegen.openapi.client.OpenApiClientOperation) Node(org.kie.api.definition.process.Node) WorkItemNode(org.jbpm.workflow.core.node.WorkItemNode)

Aggregations

OpenApiTaskDescriptor (org.jbpm.compiler.canonical.descriptors.OpenApiTaskDescriptor)1 WorkItemNode (org.jbpm.workflow.core.node.WorkItemNode)1 Node (org.kie.api.definition.process.Node)1 OpenApiClientOperation (org.kie.kogito.codegen.openapi.client.OpenApiClientOperation)1