Search in sources :

Example 1 with HistoricProcessInstanceResourceRepository

use of io.crnk.data.activiti.internal.repository.HistoricProcessInstanceResourceRepository in project crnk-framework by crnk-project.

the class ActivitiModule method setupModule.

@Override
public void setupModule(ModuleContext context) {
    this.moduleContext = context;
    TaskService taskService = processEngine.getTaskService();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    FormService formService = processEngine.getFormService();
    resourceMapper = new ActivitiResourceMapper(context.getTypeParser(), config.getDateTimeMapper());
    HistoryService historyService = processEngine.getHistoryService();
    for (ProcessInstanceConfig processInstanceConfig : config.getProcessInstances().values()) {
        context.addRepository(new ProcessInstanceResourceRepository(runtimeService, historyService, resourceMapper, processInstanceConfig.getProcessInstanceClass(), processInstanceConfig.getBaseFilters()));
        Class<? extends HistoricProcessInstanceResource> historyClass = processInstanceConfig.getHistoryClass();
        if (historyClass != null) {
            context.addRepository(new HistoricProcessInstanceResourceRepository(historyService, resourceMapper, historyClass, processInstanceConfig.getBaseFilters()));
        }
        for (ProcessInstanceConfig.TaskRelationshipConfig taskRel : processInstanceConfig.getTaskRelationships().values()) {
            context.addRepository(new TaskRelationshipRepository(processInstanceConfig.getProcessInstanceClass(), taskRel.getTaskClass(), taskRel.getRelationshipName(), taskRel.getTaskDefinitionKey()));
        }
    }
    for (TaskRepositoryConfig taskConfig : config.getTasks().values()) {
        context.addRepository(new TaskResourceRepository(taskService, resourceMapper, taskConfig.getTaskClass(), taskConfig.getBaseFilters()));
        Class<? extends TaskResource> historyClass = taskConfig.getHistoryClass();
        if (historyClass != null) {
            context.addRepository(new HistoricTaskResourceRepository(historyService, resourceMapper, historyClass, taskConfig.getBaseFilters()));
        }
        Class<? extends FormResource> formClass = taskConfig.getFormClass();
        if (formClass != null) {
            context.addRepository(new FormResourceRepository(formService, taskService, resourceMapper, formClass));
        }
    }
    context.addRepository(new FormRelationshipRepository());
}
Also used : HistoricProcessInstanceResourceRepository(io.crnk.data.activiti.internal.repository.HistoricProcessInstanceResourceRepository) RuntimeService(org.activiti.engine.RuntimeService) ActivitiResourceMapper(io.crnk.data.activiti.mapper.ActivitiResourceMapper) TaskService(org.activiti.engine.TaskService) FormService(org.activiti.engine.FormService) HistoryService(org.activiti.engine.HistoryService) HistoricProcessInstanceResourceRepository(io.crnk.data.activiti.internal.repository.HistoricProcessInstanceResourceRepository) ProcessInstanceResourceRepository(io.crnk.data.activiti.internal.repository.ProcessInstanceResourceRepository) HistoricTaskResourceRepository(io.crnk.data.activiti.internal.repository.HistoricTaskResourceRepository) TaskResourceRepository(io.crnk.data.activiti.internal.repository.TaskResourceRepository) HistoricTaskResourceRepository(io.crnk.data.activiti.internal.repository.HistoricTaskResourceRepository) FormResourceRepository(io.crnk.data.activiti.internal.repository.FormResourceRepository) FormRelationshipRepository(io.crnk.data.activiti.internal.repository.FormRelationshipRepository) TaskRelationshipRepository(io.crnk.data.activiti.internal.repository.TaskRelationshipRepository)

Aggregations

FormRelationshipRepository (io.crnk.data.activiti.internal.repository.FormRelationshipRepository)1 FormResourceRepository (io.crnk.data.activiti.internal.repository.FormResourceRepository)1 HistoricProcessInstanceResourceRepository (io.crnk.data.activiti.internal.repository.HistoricProcessInstanceResourceRepository)1 HistoricTaskResourceRepository (io.crnk.data.activiti.internal.repository.HistoricTaskResourceRepository)1 ProcessInstanceResourceRepository (io.crnk.data.activiti.internal.repository.ProcessInstanceResourceRepository)1 TaskRelationshipRepository (io.crnk.data.activiti.internal.repository.TaskRelationshipRepository)1 TaskResourceRepository (io.crnk.data.activiti.internal.repository.TaskResourceRepository)1 ActivitiResourceMapper (io.crnk.data.activiti.mapper.ActivitiResourceMapper)1 FormService (org.activiti.engine.FormService)1 HistoryService (org.activiti.engine.HistoryService)1 RuntimeService (org.activiti.engine.RuntimeService)1 TaskService (org.activiti.engine.TaskService)1