> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aseeflow.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Repository Service

It is also possible to access the BPMN model instance by the process definition id using the [Repository Service](/user-guide/process-engine/process-engine-api#services-api), as the following incomplete test sample code shows. Please see the [generate-jsf-form](https://github.com/camunda/camunda-bpm-examples/tree/master/bpmn-model-api/generate-jsf-form) quickstart for a complete example.

```java theme={null}
public void testRepositoryService() {
  runtimeService.startProcessInstanceByKey(PROCESS_KEY);
  String processDefinitionId = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey(PROCESS_KEY).singleResult().getId();
  BpmnModelInstance modelInstance = repositoryService.getBpmnModelInstance(processDefinitionId);
}
```
