# How use the Java API inside the Spring Boot Embedded

**URL:** <https://forum.camunda.io/t/how-use-the-java-api-inside-the-spring-boot-embedded/20611>\
**Category:** Discussion & Questions\
**Tags:** spring-boot-starter\
**Created:** [June 10, 2020, 11:41pm UTC](https://forum.camunda.io/t/how-use-the-java-api-inside-the-spring-boot-embedded/20611 "2020-06-10T23:41:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cvinicius](https://forum.camunda.io/letter_avatar_proxy/v4/letter/c/7ba0ec/32.png) [@cvinicius](https://forum.camunda.io/u/cvinicius)\
**Post date:** [June 10, 2020, 11:41pm UTC](https://forum.camunda.io/t/how-use-the-java-api-inside-the-spring-boot-embedded/20611/1 "2020-06-10T23:41:45Z")

</div>

Hi

I was using Camunda REST API for communication because my Engine Server were on Remote Server, but now I am using a Embedded Server with Spring Boot, so I would like to use the Java API directly, for example:

**To create Tenant:**

> ```
> Tenant tenant = identityService.newTenant(TENANT_ONE);
> tenant.setName("Tenant");
> identityService.saveTenant(tenant);
> 
> ```

There is documentation for use the engine resources without REST API ?

---

<div class="post-metadata">

**Author:** ![aravindhrs](https://forum.camunda.io/user_avatar/forum.camunda.io/aravindhrs/32/32503_2.png) [@aravindhrs](https://forum.camunda.io/u/aravindhrs)\
**Post date:** [June 11, 2020, 4:16am UTC](https://forum.camunda.io/t/how-use-the-java-api-inside-the-spring-boot-embedded/20611/2 "2020-06-11T04:16:26Z")

</div>

@cvinicius From this page each topic was explained with Java Api example.

[https://docs.camunda.org/manual/latest/user-guide/process-engine/](https://docs.camunda.org/manual/latest/user-guide/process-engine/)

> **[camunda/camunda-bpm-examples](https://github.com/camunda/camunda-bpm-examples/tree/master/spring-boot-starter)**
>
> A collection of usage examples for camunda BPM intended to get you started quickly - camunda/camunda-bpm-examples

> **[camunda-consulting/code](https://github.com/camunda-consulting/code/tree/master/snippets)**
>
> Examples and demo applications built by the camunda consulting team - camunda-consulting/code

**In spring environment, you can autowire these process engine services.**

```auto
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
TaskService taskService = processEngine.getTaskService();
IdentityService identityService = processEngine.getIdentityService();
FormService formService = processEngine.getFormService();
HistoryService historyService = processEngine.getHistoryService();
ManagementService managementService = processEngine.getManagementService();
FilterService filterService = processEngine.getFilterService();
ExternalTaskService externalTaskService = processEngine.getExternalTaskService();
CaseService caseService = processEngine.getCaseService();
DecisionService decisionService = processEngine.getDecisionService();

```

* * *

```auto
@Component
public class MyService{
   
  @Autowired
  private IdentityService identityService;

  public void saveTenant(){
    Tenant tenant = identityService.newTenant(TENANT_ONE);
    tenant.setName("Tenant");
    identityService.saveTenant(tenant);
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 12:27pm UTC](https://forum.camunda.io/t/how-use-the-java-api-inside-the-spring-boot-embedded/20611/3 "2024-01-30T12:27:40Z")

</div>

Closed on January 30, 2024, 12:27pm UTC


