Skip to end of metadata
Go to start of metadata

https://jira.kuali.org/browse/KRACOEUS-5873

Table of Contents

Functional Description

KRMS Terms and Concepts

Agenda - a collection of rules in a defined plan.
Rule - the logical expression in an Agenda. It consists of two parts, a proposition that returns a true of false value and an action or set of actions. The entire example presented above is a rule.
Proposition - the logic that makes up a rule. A proposition is a single expression of logic that returns true or false. Propositions can be compounded, created using AND, OR, or both to create more complex logic.
Action - the steps to perform in the event that the rule, after being evaluated against the propositions, returns TRUE. In the example stated above this would involve routing the document to the HR eVerify workgroup and presenting a warning on the document.
Term - the definition of data that is evaluated in a proposition. hr.hire_date, cg.grant_type, etc. are examples of Terms in the working example.
Term Specification - the definition of the type of data that is to be expected in the UI.
Fact - the actual data for the term being evaluated in a proposition, the data being passed in for evaluation.
Context - a collection of agendas, rules, terms, term specifications.
Term Resolver - A term resolver tells the engine where to get the value for a term. In some cases the term may be passed into the rule, in other cases a term resolver will be necessary to pull the value of a term from another source (a database for example). Term resolvers can be chained to each other as well to find the value of the desired term based on the presence of another term.
PeopleFlow - routing stops with members and delegates. Can be comprised of principals, groups, and/or roles.
Category - Categories are a way, within a namespace to group terms. When you create a rule, you can select a category to narrow down the term options you get.

Rice Documentation Page

Implementation Details

KC executes KRMS rules at Unit level. When creating Agenda, user has to select Unit Agenda Type and mention unit to which the Agenda operates on. When executing a particular Agenda, the rules attached to that Agenda runs only on the mentioned Unit Hierarchy.

Agenda:

Out of the box KC comes with two types of Agenda, Unit Agenda Type and Questionnaire Agenda Type. Unit Agenda Type should be selected for any rules, which are associated with a unit and Questionnaire Agenda Type should be selected to create any Questionnaire rules.

Terms:

Terms and Term Resolvers are used to define propositions while creating rules. Terms are composed of Term Keys and Facts. Term Resolvers are responsible for resolving Terms with appropriate Facts.

Term Categories:

There are three types of Term Categories, which are, Property, Function and Questionnaire.

Property Term: Users can create Property Terms by using Term and Term Specification maintenance screens. Any member variable defined in document BO can be given as a Term.

Supported Property Term Data types:
java.lang.String
java.sql.Date
java.lang.Boolean
java.lang.Integer
java.lang.Float
java.lang.Double
java.math.BigDecimal

Eg: 1
To create a Term Activity Type Code for Proposal Development Document:

Term Specification Maintenance Document

  • Select ‘Create new ‘ for Term Specification
  • Namespace -> KC-PD – Proposal Development
  • Name -> activityTypeCode
  • Date Type -> java.lang.String
  • Description -> Activity Type Code
  • Active -> checked
  • For Context list, Select context as KC-PD-CONTEXT and add context
  • For Category list, select Namespace as KC-PD and Name as Property and add category
  • Submit the Term creates a new Term Specification.

Term Maintenance Document

  • Select ‘Create new’ button of Term
  • Select Namespace code as KC-PD – Proposal Development
  • Search for Term Specification name ‘activityTypeCode’ and select that Term Specification.
  • Submit Term, which creates Term ‘activityTypeCode’

Eg: II

To create a Term Total Cost for Budget Document:

Term Specification Maintenance Document

  • Select ‘Create new ‘ for Term Specification
  • Namespace -> KC-B – Budget
  • Name -> totalCost
  • Date Type -> java.math.BigDecimal
  • Description -> Total Cost
  • Active -> checked
  • For Context list, Select context as KC-PD-CONTEXT and add context
  • For Category list, select Namespace as KC-PD and Name as Property and add category
  • Submit the Term creates a new Term.

Term Maintenance Document

  • Select ‘Create new’ button of Term
  • Select Namespace code as KC-B – Budget
  • Search for Term Specification name ‘totalCost’ and select that Term Specification.
  • Submit Term, which created Term ‘totalCost’

Check Table below for more Term Properties details

Namespace

Document BO

Datadictionary

Examples

KC-PD – Proposal Development

org.kuali.kra.proposaldevelopment.bo.DevelopmentProposal.class

DevelopmentProposal.xml

ownedByUnitNumber
proposalTypeCode
deadlineType

KC-B – Budget

org.kuali.kra.budget.core.Budget.class

Budget.xml

startDate
totalCost
totalDirectCost

KC-AWARD – Award

org.kuali.kra.award.home.Award.class

Award.xml

subPlanFlag
basisOfPaymentCode
accountNumber

KC-PROTOCOL – KC IRB Protocol

org.kuali.kra.irb.Protocol

Protocol.xml

protocolTypeCode
leadUnitNumber
expirationDate

KC-IACUC – KC IACUC Protocol

org.kuali.kra.iacuc.IacucProtocol.class

IacucProtocol.xml

layStatement1
lastApprovalDate
overviewTimeline

KC-COIDISCLOSURE – KC Coi Disclosure

org.kuali.kra.coi.CoiDisclosure.class

CoiDisclosure.xml

certifiedBy
disclosureStatusCode
disclosureDispositionCode


Function Term:
Out of the box KC comes with a set of predefined Java Functions as Terms in each module. Users can use these Terms while building the rules. Users can also define their own functions separately and plug in those without touching the existing KC code base. KC 5.1 doesn’t have UI screens for adding Functions as Terms. It has to be done through backend sql scripts. Following are the steps to create Function Term.
1.    Define your own krms type service
Implement Java Service, say, MITIrbJavaFunctionKrmsTermService and MITIrbJavaFunctionKrmsTermServiceImpl and define it in the appropriate SpringBeans.xml
                  Please note that if it’s a Stored Function, you can ignore the step 1, because there is already a KRMS_TYPE is defined for handling Stored function.
2.    Insert a record into KRMS_TYP_T table
insert into KRMS_TYP_T(TYP_ID,NM,NMSPC_CD,SRVC_NM,ACTV,VER_NBR)
            values ('KC1007','MIT Custom IRB Java Function Term Service','KC-PROTOCOL','mitIrbJavaFunctionKrmsTermService','Y',1)
3.    Create a method, say ‘isProtocolAmendment’, in the service MITIrbJavaFunctionKrmsTermService
4.    Insert a record to KRMS_FUNC_T and KRMS_FUNC_PARM_T table
_Sql:
insert into KRMS_FUNC_T (FUNC_ID,NM,DESC_TXT,RTRN_TYP,VER_NBR,ACTV,TYP_ID,NMSPC_CD)
            values ('KC1049','isProtocolAmendment','Is Protocol an amendment','java.lang.Boolean',1,'Y', (select TYP_ID from KRMS_TYP_T where NM='MIT Custom IRB Java Function Term Service'' and NMSPC_CD='KC-PROTOCOL'),'KC-PROTOCOL')
insert into KRMS_FUNC_PARM_T (FUNC_PARM_ID,FUNC_ID,NM,DESC_TXT,TYP,SEQ_NO)
            values ('KC0095',(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL'), 'IrbProtocol','Irb Protocol BO','org.kuali.kra.protocol.ProtocolBase',1)
5.    Insert record into KRMS_TERM_SPEC_T , KRMS_TERM_T, KRMS_CNTXT_VLD_TERM_SPEC_T, KRMS_TERM_SPEC_CTGRY_T
Sql:
insert into KRMS_TERM_SPEC_T (TERM_SPEC_ID, NMSPC_CD, NM, DESC_TXT, TYP, ACTV, VER_NBR)
            values ('KC2050','KC-PROTOCOL',(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL'), 'Is Protocol an amendment','java.lang.Boolean','Y',1)
insert into KRMS_TERM_T(TERM_ID,TERM_SPEC_ID,VER_NBR,DESC_TXT)
            values ('KC2035',(select TERM_SPEC_ID from KRMS_TERM_SPEC_T where NMSPC_CD='KC-PROTOCOL' and NM=(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL')), 1,'Is Protocol an amendment')
insert into KRMS_CNTXT_VLD_TERM_SPEC_T (CNTXT_TERM_SPEC_PREREQ_ID, CNTXT_ID, TERM_SPEC_ID, PREREQ)
            values ('KC2050','KC-PROTOCOL-CONTEXT',(select TERM_SPEC_ID from KRMS_TERM_SPEC_T where NMSPC_CD='KC-PROTOCOL' and NM=(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL')), 'Y')

insert into KRMS_TERM_SPEC_CTGRY_T (TERM_SPEC_ID, CTGRY_ID)
            values ((select TERM_SPEC_ID from KRMS_TERM_SPEC_T where NMSPC_CD='KC-PROTOCOL' and NM=(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL')), (select CTGRY_ID from KRMS_CTGRY_T where NMSPC_CD='KC-PROTOCOL' and NM='Function'))
6. Attach the Term to appropriate Term Resolver.
a. If it’s a Java function use 'Function Term Resolver Type Service’ as KRMS_TYPE name
b. If it’s a Stored Function, use 'Stored Function Term Resolver Type Service’ as KRMS_TYPE name
Sql:insert into KRMS_TERM_RSLVR_T (TERM_RSLVR_ID, NMSPC_CD, NM, TYP_ID, OUTPUT_TERM_SPEC_ID, ACTV, VER_NBR)
            values ('KC2046','KC-PROTOCOL','Protocol amendment check Resolver', (select TYP_ID from KRMS_TYP_T where NM='Function Term Resolver Type Service' and NMSPC_CD='KC-KRMS'), (select TERM_SPEC_ID from KRMS_TERM_SPEC_T where NMSPC_CD='KC-PROTOCOL' and NM=(select FUNC_ID from KRMS_FUNC_T where  NM='isProtocolAmendment' and NMSPC_CD='KC-PROTOCOL')), 'Y',1)
7. If there is a user input parameter, insert it into KRMS_TERM_RSLVR_PARM_SPEC_T
Sql:insert into KRMS_TERM_RSLVR_PARM_SPEC_T(TERM_RSLVR_PARM_SPEC_ID, TERM_RSLVR_ID, NM, VER_NBR)
            values ('KC2047', (select TERM_RSLVR_ID from KRMS_TERM_RSLVR_T where NM='Protocol amendment check Resolver ' and NMSPC_CD='KC-PROTOCOL'), 'Amendment code', 1)

Action:

KRACOEUS:back to top\

  • No labels