엔티티 강화

비즈니스 모델에 정의하는 엔티티는 외부 소스에서 강화되는 속성을 가질 수 있습니다.

엔티티의 강화에 사용할 데이터 제공자는 비즈니스 모델에서 정의되어야 합니다. 또한 규칙과 유사한 문장을 사용하여 비즈니스 모델에 속성의 강화를 정의해야 합니다. 강화 규정에는 리턴될 속성 및 데이터 제공자의 이름이 포함됩니다. 예를 들어, 다음 규정은 엔티티 유형 airport의 latitude 및 longitude 속성을 정의합니다. 이는 weather provider 데이터 제공자를 사용하여 강화됩니다.

an airport is enriched by the weather provider,
   given
      the latitude from the latitude of this airport,
      the longitude from the longitude of this airport,
   setting
      the temperature to the temperature of this weather provider,
      the wind speed to the wind speed of this weather provider,
      the precipitation to the precipitation of this weather provider.

비즈니스 모델에는 airport 엔티티에 대한 다음 정의가 포함되어야 합니다.

an airport is a business entity identified by an IATA code with
   a latitude (a number),
   a longitude (a number),
   a precipitation level (a number),
   a wind speed (a number),
   a temperature (a number).

데이터 제공자는 이름, 필수 속성 및 리턴된 데이터를 지정함으로써 정의됩니다.

a weather provider is a data provider,
   accepts
      a latitude (a number),
      a longitude (a number),
   returns
      a temperature (a number),
      a wind speed  (a number),
      a precipitation  (a number).

에이전트가 airport 엔티티의 temperature, wind speed 또는 precipitation의 값을 요청할 경우, 런타임이 연관된 weather provider를 호출합니다. 리턴된 속성의 값은 기본적으로 트랜잭션 동안 캐시됩니다. 데이터 제공자에 대한 반복된 호출 비용을 줄이기 위해 단일 트랜잭션보다 긴 값을 캐시할 수 있습니다.

참고: 여러 제공자가 하나의 엔티티를 강화할 수 있습니다. 엔티티의 속성일 수 있는 하나 이상의 입력 값을 지정할 수 있습니다(속성의 속성 포함). 둘 이상의 데이터 제공자를 가진 단일 속성은 강화할 수 없습니다.

데이터 제공자를 구현할 경우 데이터 제공자 확장기능 마법사를 사용하여 전용 DataProvider API 클래스를 작성합니다. DataProvider 클래스는 복잡한 속성 값을 리턴하는 getConceptFactory 메소드를 제공합니다. 기본 구현은 @DataProviderDescriptor 어노테이션을 사용하여 구현을 비즈니스 모델 규정에 정의된 제공자 이름에 바인드합니다.

DataProvider 구현은 솔루션의 일부인 확장 프로젝트에 배치됩니다. 전체 솔루션에는 비즈니스 모델 강화 규정에 이름이 지정된 각 제공자에 대해 하나의 구현이 포함되어야 합니다. 각 데이터 제공자 이름은 솔루션 내에서 고유해야 합니다.

다음 그림은 비즈니스 모델에서 데이터 강화가 정의되는 방법을 보여줍니다. 에이전트에서 강화된 속성 값을 필요로 하면 런타임이 데이터 제공자 구현을 분석하고 로드합니다(예를 들어, 규칙에서 해당 속성을 참조하여). 그리드는 트랜잭션 간 데이터를 캐시하고 공유합니다.

데이터 제공자 구현의 런타임 로딩을 보여주는
그림.