001    /**
002     * Copyright 2005-2012 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.kew.rule.service;
017    
018    import java.util.List;
019    
020    import org.kuali.rice.core.framework.impex.xml.XmlExporter;
021    import org.kuali.rice.core.framework.impex.xml.XmlLoader;
022    import org.kuali.rice.kew.api.rule.Rule;
023    import org.kuali.rice.kew.api.rule.RuleDelegation;
024    import org.kuali.rice.kew.api.rule.RuleTemplate;
025    import org.kuali.rice.kew.rule.RuleBaseValues;
026    import org.kuali.rice.kew.rule.RuleDelegationBo;
027    import org.kuali.rice.kew.rule.bo.RuleTemplateBo;
028    import org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo;
029    import org.springframework.cache.annotation.CacheEvict;
030    
031    /**
032     * A service providing data access for {@link org.kuali.rice.kew.rule.bo.RuleTemplateBo}s and
033     * {@link org.kuali.rice.kew.rule.bo.RuleTemplateAttributeBo}s.
034     *
035     * @author Kuali Rice Team (rice.collab@kuali.org)
036     */
037    public interface RuleTemplateService extends XmlLoader, XmlExporter {
038        @CacheEvict(value={RuleTemplate.Cache.NAME}, allEntries = true)
039        public void save(RuleTemplateBo ruleTemplate);
040        @CacheEvict(value={RuleTemplate.Cache.NAME}, allEntries = true)
041        public void save(RuleTemplateAttributeBo ruleTemplateAttribute);
042        @CacheEvict(value={RuleTemplate.Cache.NAME, Rule.Cache.NAME, RuleDelegation.Cache.NAME}, allEntries = true)
043        public void saveRuleDefaults(RuleDelegationBo ruleDelegation, RuleBaseValues ruleBaseValues);
044        public RuleTemplateBo findByRuleTemplateId(String ruleTemplateId);
045        public List<RuleTemplateBo> findAll();
046        public List findByRuleTemplate(RuleTemplateBo ruleTemplate);
047        @CacheEvict(value={RuleTemplate.Cache.NAME}, allEntries = true)
048        public void delete(String ruleTemplateId);
049        
050        public void deleteRuleTemplateOption(String ruleTemplateOptionId);
051    //    public void deleteRuleTemplateAttribute(Long ruleTemplateAttributeId, List ruleTemplateAttributes);
052        public RuleTemplateAttributeBo findByRuleTemplateAttributeId(String ruleTemplateAttributeId);
053        public RuleTemplateBo findByRuleTemplateName(String ruleTemplateName);
054        public String getNextRuleTemplateId();
055        
056    }