엔티티 로더 편집기에서는 BOM 어휘에 대한 액세스를 제공합니다. 구성 세트를 작성하여 로드하려는
솔루션 BOM 프로젝트에서 엔티티를 정의합니다. 이를 정의하면 특정 엔티티 ID를 가진 엔티티를 한 번만 로드할 수 있습니다.
시작하기 전에
엔티티 로더를 작성하기 전에 테스트 클라이언트 프로젝트를 작성해야 합니다.
이 태스크 정보
엔티티 로더에서 솔루션의 테스트 엔티티를 정의할 수 있습니다. 엔티티 로더 구문은
Intellirule 편집기에서 제어하며 비즈니스 규칙 언어를 기반으로
합니다. 특정 언어 구성은 변수를 사용하고 엔티티를 수정할 수 있습니다.
엔티티 로더 파일(.eldr)에 있는 모든 엔티티는 load <entity> 구문을
사용하여 정의되어야 합니다. 엔티티는 특정 순서에 따라 지정할 수 있습니다.
프로시저
- 엔티티 로더 파일을 작성하십시오.
- 솔루션 맵에서 엔티티 로더 작성을 클릭하십시오.
- 엔티티 로더 마법사의 작업공간에서 테스트 클라이언트 프로젝트를
선택한 후 엔티티 로더 파일의 이름을 입력하십시오.
- 완료를 클릭하십시오.
.eldr 파일은 테스트 클라이언트 프로젝트의 엔티티
로더 폴더에 저장됩니다. 편집기에 파일이 열립니다.
- .eldr 파일의 텍스트 편집기를 여십시오.
- 스페이스 또는 Ctrl+스페이스를 눌러서 사용 가능한 구성을 보십시오.
- 구성을 두 번 클릭하여 이를 정의에 삽입하십시오.
the customer를
Jane으로 식별하는 변수를 정의하려면 다음 행을 입력하십시오.
define 'the customer' as the customer identified by "Jane" ;.
그리고 이 변수를 사용하여
load 구성에서
the customer를 참조할 수 있습니다. 예:
define 'the customer' as a new customer where the customer id is "Jane" ;
load 'the customer' ;
- 옵션: 엔티티와 관련된 개념을 추가하십시오. 다음 예에서 새 고객 Jane을 id,
first name,
last
name으로 식별합니다.
define 'Jane' as a new customer where
the customer id is "jane@example.com",
the first name is "Jane" ,
the last name is "Doe" ;
load Jane ;
- 로더에 포함할 개별 엔티티에 load 구성을
추가하십시오. 이 엔티티는 변수 이름이나 특정 유형의 새 엔티티를
나타낼 수 있습니다.
load 구성에서 변수를
사용할 수 있습니다. 다음 예에서 where 뒤에 변수 차량 번호가 오고
이틀 동안 배달 밴의 위치를 추적하기 위해 이동 도형이 설정됩니다.
load a new delivery van where
the vehicle number is "12347" ,
the location is a new moving geometry tracked for 2 days ;
- 옵션: add 구성을 사용하여 특정 값이 있는 새 오브젝트를
추가하십시오. 다음 예제에서는 orange 제품이
Janes Cart에 있는 항목에 추가됩니다.
define 'Janes Cart' as a new shopping cart where
the customer is Jane ,
the shopping cart id is "123456789" ;
add the product identified by 'orange' to the products of 'Janes Cart' ;
load 'Janes Cart' ;
- 모든 엔티티에 해당 load 구성이 있는지 개별
define, add 및
load 구성이 세미콜론(;)으로 끝나는지 확인하십시오.
- 파일을 저장하십시오.
예
- 엔티티 로드
- 다음 예에서 제인의 장바구니에 오렌지가 추가되기 전에 모두 세 개의 엔티티가 로드됩니다.
define 'Jane' as a new customer where
the customer id is "jane@example.com",
the first name is "Jane" ,
the last name is "Doe" ;
define 'Janes Cart' as a new shopping cart where
the customer is Jane ,
the shopping cart id is "123456789" ;
load Jane ;
define 'orange' as "ORANGE";
load a new product where
the id is 'orange' ,
the description is "An orange" ;
add the product identified by 'orange' to the products of 'Janes Cart' ;
load 'Janes Cart' ;
- 관계가 있는 엔티티 로드
- 다음 BMD에서 E1 및 E2 사이의 관계가 정의됩니다.
an E1 is a business entity identified by an e1.
an E1 has an abc.
an E2 is a business entity identified by an e2.
an E2 has an xyz.
an E2 is related to some E1s.
- 다음 엔티티 로더는 E1 및 E2 사이의 관계를 확인합니다.
define e1Instance as a new e1 where the e1 is "e1Id",
the abc is "ABCVal" ;
add the e2 identified by "e2Id" to the E1s of e1Instance ;
load e1Instance ;
load a new E2 instance where the e2 is "e2Id", the xyz is "XYZVal" ;