第1章 Getting started
1.1. Creating and running workflows with Knative Workflow plugin リンクのコピーリンクがクリップボードにコピーされました!
You can create and run the OpenShift Serverless Logic workflows locally.
1.1.1. Creating a workflow リンクのコピーリンクがクリップボードにコピーされました!
You can use the create command with kn workflow to set up a new OpenShift Serverless Logic project in your current directory.
Prerequisites
-
You have installed the OpenShift Serverless Logic
kn-workflowCLI plugin.
Procedure
Create a new OpenShift Serverless Logic workflow project by running the following command:
$ kn workflow createBy default, the generated project name is
new-project. You can change the project name by using the[-n|--name]flag as follows:Example command
$ kn workflow create --name my-project
1.1.2. Generating a list of Operator manifests リンクのコピーリンクがクリップボードにコピーされました!
After creating your workflow project, you can use the gen-manifest command with kn workflow to generate operator manifest files for your OpenShift Serverless Logic workflow project in your current directory.
Prerequisites
-
You have installed the OpenShift Serverless Logic
kn-workflowCLI plugin. - You have created an OpenShift Serverless Logic workflow project.
Procedure
Generate operator manifests for your OpenShift Serverless Logic workflow project by running the following command:
$ kn workflow gen-manifestThis creates a new file in the
./manifestsdirectory in your project.Apply the generated operator manifest to your cluster by running the following command:
$ oc apply -f manifests/01-sonataflow_hello.yaml -n <namespace>
1.1.3. Running a workflow locally リンクのコピーリンクがクリップボードにコピーされました!
You can use the run command with kn workflow to build and run your OpenShift Serverless Logic workflow project in your current directory.
Prerequisites
- You have installed Podman on your local machine.
-
You have installed the OpenShift Serverless Logic
kn-workflowCLI plugin. - You have created an OpenShift Serverless Logic workflow project.
Procedure
From the directory where you created your OpenShift Serverless Logic project, move to your project directory by running the following command:
$ cd ./<your-project-name>Run the following command to build and run your OpenShift Serverless Logic workflow project:
$ kn workflow runWhen the project is ready, the Development UI automatically opens in your browser at
localhost:8080/q/dev-uiand you will find the Serverless Workflow Tools tile available. Alternatively, you can access the tool directly usinghttp://localhost:8080/q/dev-ui/org.apache.kie.sonataflow.sonataflow-quarkus-devui/workflows.
You can execute a workflow locally using a container that runs on your machine. Stop the container with Ctrl+C.
1.1.4. Creating a Quarkus workflow project リンクのコピーリンクがクリップボードにコピーされました!
For most workflow creation and deployment scenarios, use the Operator with the kn-workflow plugin. Quarkus workflow projects are intended for development or advanced use cases.
You can use the quarkus create command with kn workflow to scaffold a new Quarkus workflow project in your current directory. You can also include additional Quarkus extensions during project creation.
For more information about Quarkus, see Red Hat build of Quarkus documentation.
Prerequisites
-
You have installed the OpenShift Serverless Logic
kn-workflowCLI plugin.
Procedure
Create a new Quarkus workflow project by running the following command:
$ kn workflow quarkus createBy default, the generated project is named
new-project. You can overwrite the project name by running the command with the--nameflag as follows:$ kn workflow quarkus create --name <your-project-name>注記The generated project contains a minimal Quarkus workflow setup, including a sample
workflow.sw.jsonfile in./<project-name>/src/main/resources/. First-time execution might take several minutes due to dependency downloads.Optional: Add one or more extensions to the Quarkus project by running the command with the
--extensionflag as follows:$ kn workflow quarkus create --extension quarkus-jsonp,quarkus-smallrye-openapiYou can include multiple extensions as a comma-separated list. For example, the following command adds the
quarkus-jsonpandquarkus-smallrye-openapiextensions:$ kn workflow quarkus create --extension quarkus-jsonp,quarkus-smallrye-openapi