1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.time.missedpunch.rules;
17
18 import org.kuali.kpme.core.api.namespace.KPMENamespace;
19 import org.kuali.kpme.core.krms.KPMERulesEngineExecuter;
20 import org.kuali.kpme.tklm.api.common.krms.TklmKrmsConstants;
21 import org.kuali.rice.kew.engine.RouteContext;
22 import org.kuali.rice.krms.api.engine.Engine;
23 import org.kuali.rice.krms.api.engine.EngineResults;
24 import org.kuali.rice.krms.api.engine.Facts;
25 import org.kuali.rice.krms.api.engine.SelectionCriteria;
26
27 import java.util.HashMap;
28 import java.util.Map;
29
30
31 public class MissedPunchRulesEngineExecutor extends KPMERulesEngineExecuter {
32 @Override
33 protected EngineResults performExecute(RouteContext routeContext, Engine engine) {
34 Map<String, String> contextQualifiers = new HashMap<String, String>();
35 contextQualifiers.put("namespaceCode", KPMENamespace.KPME_TK.getNamespaceCode());
36 contextQualifiers.put("name", TklmKrmsConstants.MissedPunch.KPME_MISSED_PUNCH_CONTEXT_NAME);
37 SelectionCriteria selectionCriteria = SelectionCriteria.createCriteria(null, contextQualifiers, new HashMap<String, String>());
38
39 Facts.Builder factsBuilder = Facts.Builder.create();
40
41 EngineResults results = engine.execute(selectionCriteria, factsBuilder.build(), null);
42 return results;
43 }
44 }