1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.ruleevent;
17
18 import org.kuali.rice.krad.maintenance.MaintenanceDocument;
19 import org.kuali.rice.krad.maintenance.MaintenanceDocumentController;
20 import org.kuali.rice.krad.web.form.DocumentFormBase;
21 import org.kuali.rice.krad.web.form.MaintenanceDocumentForm;
22 import org.kuali.rice.krad.web.form.UifFormBase;
23 import org.springframework.stereotype.Controller;
24 import org.springframework.web.bind.annotation.RequestMapping;
25 import org.springframework.web.servlet.ModelAndView;
26
27
28
29
30
31
32 @Controller
33 @RequestMapping(value = "/ruleEvent")
34 public class RuleEventController extends MaintenanceDocumentController {
35
36 @Override
37 @RequestMapping(params = "methodToCall=save")
38 public ModelAndView save(UifFormBase form) {
39 MaintenanceDocumentForm docForm = (MaintenanceDocumentForm) form;
40 MaintenanceDocument document = docForm.getDocument();
41
42 RuleEventImpl event = new RuleEventImpl(document);
43 event.setName("Lab-RuleEventController");
44 event.addFact("RuleEventSave", document.getDocumentDataObject());
45 event.setRuleMethodName("processRule");
46
47 super.save(docForm, event);
48
49 return getModelAndView(form);
50 }
51 }