Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP PR for SRVLOGIC-128: [DOC] Modularize the "Getting Started" (top-level) section. #335

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions serverlessworkflow/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ display_version: snapshot
prerelease: snapshot
start_page: index.adoc
MarianMacik marked this conversation as resolved.
Show resolved Hide resolved
nav:
- "modules/ROOT/pages/getting-started/nav.adoc"
- "modules/ROOT/nav.adoc"
asciidoc:
attributes:
Expand Down
8 changes: 4 additions & 4 deletions serverlessworkflow/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// * xref:index.adoc[Home]
* xref:release_notes.adoc[Release notes]
* Getting Started
** xref:getting-started/create-your-first-workflow-service.adoc[Creating your first workflow service]
** xref:getting-started/cncf-serverless-workflow-specification-support.adoc[CNCF Serverless Workflow specification]
** xref:getting-started/getting-familiar-with-our-tooling.adoc[Getting familiar with tooling]
//* Getting Started
//** xref:getting-started/create-your-first-workflow-service.adoc[Creating your first workflow service]
//** xref:getting-started/cncf-serverless-workflow-specification-support.adoc[CNCF Serverless Workflow specification]
//** xref:getting-started/getting-familiar-with-our-tooling.adoc[Getting familiar with tooling]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we commenting these sections?

* Core
** xref:core/understanding-jq-expressions.adoc[jq expressions]
** xref:core/understanding-workflow-error-handling.adoc[Error handling]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* A workflow project is created.
+
For more information about creating a workflow project, see xref:getting-started/create-your-first-workflow-service.adoc[Creating your first Serverless Workflow service].
For more information about creating a workflow project, see xref:getting-started/getting-started-modules/create-your-first-workflow-service.adoc[Creating your first Serverless Workflow service].
MarianMacik marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
= CNCF Serverless Workflow specification
:compat-mode!:
// Metadata:
:_content-type: ASSEMBLY
:description: CNCF Serverless Workflow Specification Support
:keywords: kogito, workflow, serverless, cncf, specification
:navtitle: CNCF Serverless Workflow specification
:compat-mode!:
// Metadata:
:page-aliases:
// links
:quarkus_config_guide_url: https://quarkus.io/guides/config-reference

[id="assembly-cncf-serverless-workflow-specification-support_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{context} does not exist anymore

= CNCF Serverless Workflow specification

This document describes the information about the implementation of the link:{spec_website_url}[Cloud Native Computing Foundation (CNCF) Serverless Workflow] specification. {product_name} implements version link:{spec_doc_url}[{spec_version}] of the Serverless Workflow specification.

The following table shows the implementation status for each Serverless Workflow specification feature.
Expand Down Expand Up @@ -88,7 +93,7 @@ specification.

The link:{spec_doc_url}#parallel-state[Parallel State] of the workflow states feature works in a single thread. This means that a Parallel State does not create one thread per branch, simulating an actual parallel behavior.

If an exclusive property is set to `false`, you should not use the link:{spec_doc_url}#event-state[Event State] of the workflow states feature as the starting state. In case, if it is specified that way, then it will behave as if an exclusive property was set to `true`.
If an exclusive property is set to `false`, you should not use the link:{spec_doc_url}#event-state[Event State] of the workflow states feature as the starting state. In case, if it is specified that way, then it will behave as if an exclusive property was set to `true`.

[NOTE]
====
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
:_content-type: ASSEMBLY
:description: Creating first workflow service
:keywords: creating, serverless, workflow
:navtitle: Creating your first workflow service
:page-aliases:

[id="assembly-create-your-first-workflow-service_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context does not exist anymore

= Creating your first workflow service

As a developer, you can use {product_name} and create a `Hello World` application, which includes the following procedures:

* <<proc-boostrapping-a-project,Bootstrapping a project>>
* <<proc-creating-a-workflow,Creating a workflow>>
* <<proc-building-your-workflow-application,Building your workflow application>>
* <<proc-running-your-workflow-application,Running your workflow application>>
* <<proc-testing-your-workflow-application,Testing your workflow application>>
Comment on lines +12 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those links do not work


Also, you can directly access an example application by cloning `serverless-workflow-examples/serverless-workflow-hello-world` from the link:{kogito_sw_examples_url}/serverless-workflow-hello-world[GitHub repository].

This document describes how to create a workflow application that serves a `hello_world` endpoint. The workflow contains the following two states:

* `Inject Hello World`: Injects a `Hello World` message into the response
* `Inject Mantra`: Injects a `Mantra` message into the response

.Example Hello World workflow
image::getting-started/hello-world-workflow.png[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image does not show
image


.Prerequisites
* Java {java_min_version} is installed with `JAVA_HOME` configured appropriately.
* Apache Maven {maven_min_version} is installed.
* {quarkus_cli_url}[Quarkus CLI] or xref:tooling/kn-plugin-workflow-overview.adoc[Knative Workflow CLI] {kn_cli_version} is installed.
* Visual Studio Code with https://marketplace.visualstudio.com/items?itemName=redhat.java[Red Hat Java Extension]
and https://marketplace.visualstudio.com/items?itemName=redhat.vscode-extension-serverless-workflow-editor[Red Hat Serverless Workflow Editor] is installed to edit your workflows.

For more information about the tooling and the required dependencies, see xref:getting-started/getting-familiar-with-our-tooling.adoc[Getting familiar with {product_name} tooling].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong link ?


ifeval::["{kogito_version_redhat}" != ""]
include::../../pages/_common-content/downstream-project-setup-instructions.adoc[]
endif::[]

include::proc-boostrapping-a-project.adoc[leveloffset=+1]
include::proc-creating-a-workflow.adoc[leveloffset=+1]
include::proc-building-your-workflow-application.adoc[leveloffset=+1]
include::proc-running-your-workflow-application.adoc[leveloffset=+1]
include::proc-testing-your-workflow-application.adoc[leveloffset=+1]

== Additional resources

* xref:getting-started/getting-familiar-with-our-tooling.adoc[Getting familiar with {product_name} tooling]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong link

* xref:service-orchestration/orchestration-of-openapi-based-services.adoc[Orchestrating the OpenAPI services]

include::../../pages/_common-content/report-issue.adoc[]
MarianMacik marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
= Getting familiar with {product_name} tooling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


:compat-mode!:
// Metadata:
:_content-type: ASSEMBLY
:description: Kogito Serverless Workflow Tooling
:keywords: kogito, workflow, serverless, editor
:navtitle: Getting familiar with {product_name} tooling
:compat-mode!:
// Metadata:
:page-aliases:
// links
:kubesmarts_url: https://start.kubesmarts.org/

[id="assembly-getting-familiar-with-our-tooling_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context does not exist anymore

= Getting familiar with {product_name} tooling

The tooling in {product_name} provides the best developer experience for the workflow ecosystem. The following tools are provided that you can use to author your workflow assets:

* xref:tooling/serverless-workflow-editor/swf-editor-vscode-extension.adoc[*VS Code extension*]: Use the Serverless Workflow editor and edit the link:{spec_website_url}[CNCF Serverless Workflow specification] files in Visual Studio Code.
* xref:tooling/serverless-workflow-editor/swf-editor-vscode-extension.adoc[*VS Code extension*]: Use the Serverless Workflow editor and edit the link:{spec_website_url}[CNCF Serverless Workflow specification] files in Visual Studio Code.
* xref:tooling/serverless-workflow-editor/swf-editor-chrome-extension.adoc[*Chrome GitHub extension*]: View and edit the CNCF Serverless Workflow specification files in GitHub.
* xref:tooling/quarkus-dev-ui-extension/quarkus-dev-ui-overview.adoc[*Kogito Serverless Workflow Tools extension in Quarkus Dev UI*]: View, manage, and start the workflow instances.
* xref:tooling/kn-plugin-workflow-overview.adoc[*{product_name} plug-in for Knative CLI*]: Set up a local workflow project using the command line.
* link:{kubesmarts_url}[*Serverless Logic online tooling*]: Try and run the Serverless Workflow example applications in a web environment.
* link:{kubesmarts_url}[*Serverless Logic online tooling*]: Try and run the Serverless Workflow example applications in a web environment.

include::../../pages/_common-content/report-issue.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:_content-type: PROCEDURE
:description: Bootstrapping a project
:keywords: bootstrap, project, serverless, workflow
:navtitle: Bootstrapping a project
// :page-aliases:

[id="proc-boostrapping-a-project_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context does not exist anymore

= Bootstrapping a project

To create your workflow service, first you need to bootstrap a project.

.Procedure
. In a command terminal, use one of the following commands to create a project:
+
[tabs]
====
Quarkus CLI::
+
--
.Create a project using Quarkus CLI
[source,shell,subs="attributes+"]
----
quarkus create app \
-x={kogito_sw_ga} \
-x=quarkus-container-image-jib \
-x=quarkus-resteasy-jackson \
-x=quarkus-smallrye-openapi \
--no-code \
org.kie.kogito.examples:serverless-workflow-hello-world:1.0
----
The previous command creates a Maven Quarkus project in the `serverless-workflow-hello-world` directory containing the required dependencies, including:
* `{kogito_sw_ga}`: Adds support for workflows.
* `quarkus-container-image-jib`: Adds support for Container Image Builds.
* `quarkus-resteasy-jackson`: Adds support for RESTEasy, which is required by the generated REST resources that are used to start the flow process using an HTTP request.
* `quarkus-smallrye-openapi`: Adds support for Swagger documentation when you run the application in development mode.
* `--no-code`: Prevents workflow example code from being generated.
The SwaggerUI is available at `http://localhost:8080/q/swagger-ui/` when you run the application.
--
Apache Maven::
+
--
.Create a project using Apache Maven
[source,shell,subs="attributes"]
----
mvn {quarkus_platform}:quarkus-maven-plugin:{quarkus_version}:create \
-DprojectGroupId=org.kie.kogito.examples \
-DprojectArtifactId=serverless-workflow-hello-world \
-Dextensions="{kogito_sw_ga},quarkus-container-image-jib,quarkus-resteasy-jackson,quarkus-smallrye-openapi" \
-DnoCode
cd serverless-workflow-hello-world
----
In the previous command, `org.kie.kogito.examples`, `serverless-workflow-hello-world`, and `1.0` is group ID, artifact ID, and version of your project respectively. `-DnoCode` prevents the generation of workflow example code.
--
Knative workflow CLI::
+
--
.Create a project using Knative workflow CLI
[source,shell,subs="attributes"]
----
kn workflow create \
--name serverless-workflow-hello-world \
--extension quarkus-jsonp,quarkus-smallrye-openapi \
--quarkus-platform-group-id={quarkus_platform} \
--quarkus-version={quarkus_version}
----
For more information about Knative workflow CLI, see xref:tooling/kn-plugin-workflow-overview.adoc[{context} plug-in for Knative CLI].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {product_name} instead of {context}

--
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
:_content-type: PROCEDURE
:description: Building your workflow application
:keywords: build, serverless, workflow, application
:navtitle: Building your workflow application
// :page-aliases:

[id="proc-building-your-workflow-application_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context does not exist anymore

= Building your workflow application

ifeval::["{kogito_version_redhat}" != ""]
include::../../pages/_common-content/downstream-post-create-project.adoc[]
endif::[]

. To verify that project is created, compile the project using the following command:
+
[tabs]
====
Quarkus CLI::
+
--
.Compile your project using Quarkus CLI
[source,shell]
----
quarkus build
----
--
Apache Maven::
+
--
.Compile your project using Apache Maven
[source,shell]
----
mvn clean package
----
--
Knative workflow CLI::
+
--
.Build your project and generate a local image called `dev.local/serverless-workflow-hello-world:latest`
[source,shell]
----
kn workflow build --image dev.local/serverless-workflow-hello-world --verbose
----
The `--verbose` flag is used to display the output of the build command. This flag is optional.
For more information about Knative workflow CLI, see xref:tooling/kn-plugin-workflow-overview.adoc[{context} plug-in for Knative CLI].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {product_name} instead of {context}

--
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
:_content-type: PROCEDURE
:description: Creating a workflow
:keywords: create, serverless, workflow
:navtitle: Creating a workflow
// :page-aliases:

[id="proc-creating-a-workflow_{context}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context does not exist anymore

= Creating a workflow

After bootstrapping a project, you need to create a workflow. In the following procedure, a workflow named *Hello World Workflow* is created.

.Procedure
. Create a file named `hello.sw.json` in the `src/main/resources` directory with the following content:
+
--
.Example content for `hello.sw.json` file
[source,json]
----
{
"id": "hello_world", <1>
"version": "1.0",
"specVersion": "0.8",
"name": "Hello World Workflow",
"description": "JSON based hello world workflow",
"start": "Inject Hello World", <3>
"states": [ <2>
{
"name": "Inject Hello World",
"type": "inject", <4>
"data": { <5>
"greeting": "Hello World"
},
"transition": "Inject Mantra" <6>
},
{
"name": "Inject Mantra",
"type": "inject",
"data": {
"mantra": "Serverless Workflow is awesome!" <7>
},
"end": true <8>
}
]
}
----
In the previous example:

<1> `id` field is the unique identifier of the workflow. {product_name} generates the REST endpoints based on this unique identifier.

<2> `states` defines the states of the workflow. In the Hello World example, the workflow contains two states, such as `Inject Hello World` and `Inject Mantra`.

<3> `start` field defines the state in which the workflow starts.

<4> `type` defines the type of the state. In the previous example, the state is `inject`. The `inject` state can be used to inject static data into state data input.

<5> `data` defines the data that is injected into the state. In the previous example, `greeting` is injected with the `Hello World` value.

<6> `transition` field defines the next state that is reached after the current state is completed.

<7> Injects a `mantra` with the value `Serverless Workflow is awesome!` into the workflow data.

<8> `end` field defines that the current state is the end of the workflow. When the workflow reaches the end state, the workflow stops and the REST endpoint returns the workflow data, such as:

.Example workflow data
[source,json]
----
{
"greeting": "Hello World",
"mantra": "Serverless Workflow is awesome!"
}
----

[NOTE]
====
The workflow definition follows the CNCF Serverless Workflow specification. For more information, see
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong link

xref:getting-started/cncf-serverless-workflow-specification-support.adoc[CNCF Serverless Workflow specification].
====
--
Loading