Generic chains have several parameters and featureы that depend on metamodel and can not be defined in generic way. This is solved by the mechanism of confuguration.
Configuration attribute
Confuguration is stored in the default value of the attribute, identified by the key "gchain-config". By default, this attribute has name "FGC Config", but the name is not important, only key is used.
Exact location of this attribute in the metamodel is not important, it can be anywhere in the architecture. Only default value of this attribute is used. There is no need to create objects with this attribute.
Configuration format
Simplified configuration
This options is available starting from version 4.4.3. For lower versions, only configuration via configuration plugins is available.
Simplified configuration format can be used when only small changes are required. Simplified configuration is stored fully in the attribute.
Configuration string must be a Python dict literal, starting with the "{" symbol (more or less same as JSON format). Dictionary keys are parameters. If parameters is not used, default value is assumed.
Currently, there are following configurable parameters:
Name | Default value | Description |
---|---|---|
"systems" | [] (empty list) | List of Rule names of objects that will be treated as System in SEA |
"subchains" | [] (empty list) | List of Rule names (or keys) of objects that will be treated as block chains |
Example configuration 1 (define Block chain type)
{"subchains":["Block Chain"]}
Example configuration 2 (define 2 block chain types, system type)
{"systems":["System"], "subchains":["Block Chain A", "Block Chain B"]}
Configuration via plugin class
All parameters and behavior can be configured by writing a Python configuration class (configuration plugin) and putting fully specified class name in this attribute.
Configuration plugin must be a subclass of arkiext.ki.chains.generic_chains.DefaultChainConfig
TO change behavior user must override various methods, present in this class.
Example: define Block chain types
To add a Block Chain support to the generic project:
- Create a python class inherited from DefaultChainConfig
- Overload the method getSubChainTypes: it should return the list of Block Chain metamodel types
- Find or create (no matter where exactly - could be created under the chain metamodel type) the 'Generic Chains configuration attribute' - it should have 'gchain-config' key in the metamodel
- Define the default value for the attribute referring to the class created e.g. the block chain metamodel type is 'Rule B' config attribute is 'Generic Chains Plugin' class container file located at folder test: test\gfcconfig.py
5. set the default value for 'Generic Chains Plugin' in metamodel to: test.gfcconfig.ASChainsConfi