Search in sources :

Example 1 with FormResourceRepository

use of io.crnk.activiti.internal.repository.FormResourceRepository 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());
    for (ProcessInstanceConfig processInstanceConfig : config.getProcessInstances().values()) {
        context.addRepository(new ProcessInstanceResourceRepository(runtimeService, resourceMapper, processInstanceConfig.getProcessInstanceClass(), 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 FormResource> formClass = taskConfig.getFormClass();
        if (formClass != null) {
            context.addRepository(new FormResourceRepository(formService, taskService, resourceMapper, formClass));
            context.addRepository(new FormRelationshipRepository(taskConfig.getTaskClass(), formClass));
        }
    }
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) ActivitiResourceMapper(io.crnk.activiti.mapper.ActivitiResourceMapper) TaskService(org.activiti.engine.TaskService) FormService(org.activiti.engine.FormService) ProcessInstanceResourceRepository(io.crnk.activiti.internal.repository.ProcessInstanceResourceRepository) TaskResourceRepository(io.crnk.activiti.internal.repository.TaskResourceRepository) FormResourceRepository(io.crnk.activiti.internal.repository.FormResourceRepository) FormRelationshipRepository(io.crnk.activiti.internal.repository.FormRelationshipRepository) TaskRelationshipRepository(io.crnk.activiti.internal.repository.TaskRelationshipRepository)

Aggregations

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