001/*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005package org.kuali.rice.krms.impl.repository.mock;
006
007import org.kuali.rice.krms.api.repository.RuleManagementService;
008import org.kuali.rice.krms.api.repository.context.ContextDefinition;
009
010/**
011 *
012 * @author nwright
013 */
014public class KrmsContextLoader {
015
016    private RuleManagementService ruleManagementService = null;
017
018    public RuleManagementService getRuleManagementService() {
019        return ruleManagementService;
020    }
021
022    public void setRuleManagementService(RuleManagementService ruleManagementService) {
023        this.ruleManagementService = ruleManagementService;
024    }
025    
026    public void loadContext(String id, String namespace, String name, String typeId, String description) {
027//        CNTXT_ID      NMSPC_CD        NM      TYP_ID  ???? What kind of type  ACTV    VER_NBR DESC_TXT
028        ContextDefinition.Builder bldr = ContextDefinition.Builder.create(namespace, name);
029        bldr.setId(id);
030        bldr.setActive(true);
031        bldr.setTypeId(typeId);
032        bldr.setDescription(description);
033        this.getRuleManagementService().createContext(bldr.build());
034    }
035
036    public void load() {
037        loadContext("10000", "KS-SYS", "Course Requirements", "T1004", "Course Requirements");
038        loadContext("10001", "KS-SYS", "Program Requirements", "T1004", "Program Requirements");
039    }
040
041}