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

docs: update spring Zeebe guide #4067

Merged
merged 7 commits into from
Jul 29, 2024
Merged
25 changes: 21 additions & 4 deletions docs/guides/getting-started-java-spring.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ To deploy your process, take the following steps:
3. Change the **Cluster endpoint** to `http://localhost:26500/`, with no authentication.
4. Click **Deploy**.

When you open Operate at http://localhost:8081/, you should now note the process deployed to your local Self-Managed setup.
When you open Operate at http://localhost:8080/operate/, you should now note the process deployed to your local Self-Managed setup.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This URL changed when we switched to the plain-java installation.

Note that I've only added this change to vNext, because vCurrent still uses the docker-compose installation method.

Copy link
Member

Choose a reason for hiding this comment

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

We would also need to change the tip admonition in Step 1, but it currently states that Operate can be found at localhost:8080 (which redirects to 8080/operate/).

Copy link
Member

Choose a reason for hiding this comment

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

I said this poorly - I just expect them to match. Whether they use redirects or not, I don't care.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll get them aligned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

aligned in latest commit.


## Step 5: Run your process from Modeler

Expand Down Expand Up @@ -119,7 +119,7 @@ See our documentation on [adding the Spring Zeebe SDK to your project](/apis-too
</repositories>
```

2. Add the following dependency to your `pom.xml` file:
2. Add the following dependency your `pom.xml` file, as a child of the `<dependencies>` element:

```
<dependency>
Expand Down Expand Up @@ -181,7 +181,24 @@ In your terminal, run `mvn spring-boot:run`, where you should see the `charging

To start a process instance programmatically, take the following steps:

1. In `ProcessPaymentsApplication.java`, convert the application to a `CommandLineRunner`, by adding `implements CommandLineRunner` to the `ProcessPaymentsApplication` class declaration. Instantiate a static `Logger` variable, and an instance variable named `zeebeClient` with the `@Autowired` annotation.
1. In `ProcessPaymentsApplication.java`, add the following dependencies after the package definition:

```java
package io.camunda.demo.process_payments;

import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.spring.client.annotation.Deployment;
```
Comment on lines +185 to +199
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I lost an embarrassing amount of time trying to track down the most basic of imports (java.util.Map). We specify the imports in the previous code-heavy step; specifying them here could save someone like me from import-hunting.


2. Convert the application to a `CommandLineRunner`, by adding `implements CommandLineRunner` to the `ProcessPaymentsApplication` class declaration. Instantiate a static `Logger` variable, and an instance variable named `zeebeClient` with the `@Autowired` annotation.

```java
@SpringBootApplication
Expand All @@ -199,7 +216,7 @@ public class ProcessPaymentsApplication implements CommandLineRunner {
}
```

2. Implement an overriding `run` method in `ProcessPaymentsApplication`. When the application runs, it will create a new `process-payments` process instance, of the latest version, with specified variables, and send it to our local Self-Managed instance:
3. Implement an overriding `run` method in `ProcessPaymentsApplication`. When the application runs, it will create a new `process-payments` process instance, of the latest version, with specified variables, and send it to our local Self-Managed instance:

```java
@Override
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/react-components/install-plain-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Confirm Elasticsearch is running by visiting `http://localhost:9200` in a browse

### Download and configure Camunda

1. Download the [latest release artifact](https://github.com/camunda/camunda/releases) in the **Assets** section of the release page, starting with [8.6.0-alpha2](https://github.com/camunda/camunda/releases/tag/8.6.0-alpha2).
1. Download and extract the [latest `camunda-zeebe-` release artifact](https://github.com/camunda/camunda/releases) in the **Assets** section of the release page, starting with [8.6.0-alpha2](https://github.com/camunda/camunda/releases/tag/8.6.0-alpha2).
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this change is only added in vNext, because vCurrent uses the docker-compose installation method (nothing to extract).

2. Navigate to the directory where you installed Camunda, and open `/config/application.yaml`. Add the following Elasticsearch exporter as a child of the `zeebe`/`broker` configuration element:

```
Expand Down Expand Up @@ -183,5 +183,5 @@ Save the file. Without performing this step, no data will be visible in Operate
It may take a few minutes for startup to complete. When the message `Started StandaloneCamunda in ___ seconds` is displayed, the application is ready to use.

:::tip
Operate can be found at `http://localhost:8080/` and Tasklist can be found at `http://localhost:8080/tasklist`. Both use a default username/password of `demo`/`demo`.
Operate can be found at `http://localhost:8080/operate` and Tasklist can be found at `http://localhost:8080/tasklist`. Both use a default username/password of `demo`/`demo`.
:::
23 changes: 20 additions & 3 deletions versioned_docs/version-8.5/guides/getting-started-java-spring.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ See our documentation on [adding the Spring Zeebe SDK to your project](/apis-too
</repositories>
```

2. Add the following dependency to your `pom.xml` file:
2. Add the following dependency to your `pom.xml` file, as a child of the `<dependencies>` element:

```
<dependency>
Expand Down Expand Up @@ -190,7 +190,24 @@ In your terminal, run `mvn spring-boot:run`, where you should see the `charging

To start a process instance programmatically, take the following steps:

1. In `ProcessPaymentsApplication.java`, convert the application to a `CommandLineRunner`, by adding `implements CommandLineRunner` to the `ProcessPaymentsApplication` class declaration. Instantiate a static `Logger` variable, and an instance variable named `zeebeClient` with the `@Autowired` annotation.
1. In `ProcessPaymentsApplication.java`, add the following dependencies after the package definition:

```java
package io.camunda.demo.process_payments;

import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.spring.client.annotation.Deployment;
```

2. Convert the application to a `CommandLineRunner`, by adding `implements CommandLineRunner` to the `ProcessPaymentsApplication` class declaration. Instantiate a static `Logger` variable, and an instance variable named `zeebeClient` with the `@Autowired` annotation.

```java
@SpringBootApplication
Expand All @@ -208,7 +225,7 @@ public class ProcessPaymentsApplication implements CommandLineRunner {
}
```

2. Implement an overriding `run` method in `ProcessPaymentsApplication`. When the application runs, it will create a new `process-payments` process instance, of the latest version, with specified variables, and send it to our local Self-Managed instance:
3. Implement an overriding `run` method in `ProcessPaymentsApplication`. When the application runs, it will create a new `process-payments` process instance, of the latest version, with specified variables, and send it to our local Self-Managed instance:

```java
@Override
Expand Down
Loading