특성 초기값 계산
비즈니스 특정 규칙 특성의 초기값을 계산하려면 특성 초기값을 계산하는 인터페이스를 구현하고 키를 통해 이 인터페이스를 규칙 모델 특성과 연관시킵니다.
이 태스크 정보
예를 들면, 아티팩트에 연결된 두 개의 특성 creationDate 및 expirationDate가 있는 경우 초기값을 계산하여 creationDate 특성을 현재 날짜로 설정하고 expirationDate 특성을 현재 날짜 5년 후로 설정할 수 있습니다.
프로시저
특성의 초기값을 계산하려면 다음을 수행하십시오.
결과
다음과 같이 XML로 구현을 참조하는 키에 특성을 연관시킵니다.
<?xml version="1.0" encoding="UTF-8"?>
<model:extension-model xmlns:model="http://ilog.rules.brms.extension/model"
name="myExtension" nsURI="http://ilog.rules.brms.extension/myExtension">
<add-property className="BusinessRule">
<property extractable="true" name="creationDate" type="Date">
<annotation id="initialValueCallback" value="datesHandlerID"/>
</property>
<property extractable="true" name="expirationDate" type="Date">
<annotation id="initialValueCallback" value="datesHandlerID"/>
</property>
</add-property>
</model:extension-model>
특성에 대한 초기값 계산을 구현했습니다. 이제 초기값 계산을 Rule Designer 또는 Decision Center에 통합할 수 있습니다.
Rule Designer에 통합 |
Decision Center에 통합 |
|---|---|
| 초기값 콜백 확장점이 있는 Rule Designer 플러그인을 작성하십시오. |
Decision Center 아카이브를 리패키징하여 특성 초기값을 계산하기 위한 클래스를 통합하고 선언하십시오. |