Configuration details
- Last Updated: February 16, 2024
- 2 minute read
- Corticon
- Documentation
Several schema details note that they use Variable Substitution, Corticon's technique for in-memory data to dynamically create SQL statements using a template, as discussed in How Corticon is expressed in SQL
Columns described in Corticon query schemas are detailed as follows:
Sequence—SeveralCORTICON_ADC_READ_DEFSorCORTICON_ADC_WRITE_DEFSmight be associated with aCORTICON_ADC_READorCORTICON_ADC_WRITErecord. The values are typically strictly sequenced ascending values such as (1,4,6,7). If a value is not unique ,such as (1,4,4,7), theCORTICON_ADC_READ_DEFSorCORTICON_ADC_WRITE_DEFSmight not fire in the same way in the next execution.SQL—In SQL READ Statements, you can incorporate a complexWHEREclause using Corticon’s Variable Substitution, so that you can specify values in the SQL that will be replaced with corresponding values based on what is currently in the working memory of the execution.SQL—In SQL WRITE Statements, you can use Variable Substitution to add Primary Entity values directly into the SQL. Since the structure of anINSERTandUPDATEstatement are different from aSELECTstatement, Variable Substitution does not aggregate all values to create one SQL statement – instead, it will use the SQL as a template to create a SQL statement for each Primary Entity instance.PRIMARY_ENTITY—The results from the SQL Statement need to be converted to map to Corticon Entities. ADC does not automatically create a new instance of the Entity in memory. First, it will determine if that Entity is already in memory, and—if it is not already in memory—a new Entity instance of type(PRIMARY_ENTITY)will be created, usingICcDataObjectManager.createEntity(<PRIMARY_ENTITY>.Then, the Column Values for that Row will be added into that new instance of the Entity. Duplication of Entity instances is prevented when the rules engine checks to see whether that Entity instance is already in memory. This is done by comparing each in-memory Entity instance’s “Entity Identity” values with the values retrieved for that row. If the instance already exists, then it will use that instance, and then merge the Column Values into that Entity instance.PARENT_ENTITYandPARENT_ROLENAME—The Association’s Join Expression is critical to the mapping of Associations between thePARENT_ENTITYand thePRIMARY_ENTITY. ADC parses the Join Expression to determine which Attributes in the Parent Entity need to match which Attributes in the Primary Entity. For each Primary Entity retrieved, an algorithm is used to match these values between two different Entities. If there is a match, the Primary Entity is added to the Parent Entity’s Association as defined by the Parent Role Name.Note:PARENT_ENTITYandPARENT_ROLENAMEare optional, and only needed when an ADC Read (SELECTstatement) occurs where you want the newly-retrieved Entities to automatically associate with an in-memoryPARENT_ENTITY.Enable—For testing purposes, you may want to test someCORTICON_ADC_READ_DEFSorCORTICON_ADC_WRITE_DEFSout of all the ones associated with theCORTICON_ADC_READorCORTICON_ADC_WRITE. You can add all yourCORTICON_ADC_READ_DEFSandCORTICON_ADC_WRITE_DEFSand then incrementally expand the retrieval, while testing each step.