Search in sources :

Example 1 with ApprovalRelationshipRepository

use of io.crnk.activiti.example.approval.ApprovalRelationshipRepository in project crnk-framework by crnk-project.

the class ApprovalTestApplication method createApprovalModule.

// tag::approvalModule[]
public static SimpleModule createApprovalModule(ApprovalManager approvalManager) {
    FilterSpec approvalFilter = new FilterSpec(Arrays.asList("definitionKey"), FilterOperator.EQ, "scheduleChange");
    List<FilterSpec> approvalFilters = Arrays.asList(approvalFilter);
    SimpleModule module = new SimpleModule("approval");
    module.addRepositoryDecoratorFactory(ApprovalRepositoryDecorator.createFactory(approvalManager));
    module.addRepository(new ApprovalRelationshipRepository(Schedule.class, ScheduleApprovalProcessInstance.class, "approval", "approval/schedule", approvalFilters));
    return module;
}
Also used : Schedule(io.crnk.test.mock.models.Schedule) ScheduleApprovalProcessInstance(io.crnk.activiti.example.model.ScheduleApprovalProcessInstance) ApprovalRelationshipRepository(io.crnk.activiti.example.approval.ApprovalRelationshipRepository) FilterSpec(io.crnk.core.queryspec.FilterSpec) SimpleModule(io.crnk.core.module.SimpleModule)

Aggregations

ApprovalRelationshipRepository (io.crnk.activiti.example.approval.ApprovalRelationshipRepository)1 ScheduleApprovalProcessInstance (io.crnk.activiti.example.model.ScheduleApprovalProcessInstance)1 SimpleModule (io.crnk.core.module.SimpleModule)1 FilterSpec (io.crnk.core.queryspec.FilterSpec)1 Schedule (io.crnk.test.mock.models.Schedule)1