The configuration memory is mapped by means of two interfaces gip.core.datamodel.IACConfigStore and gip.core.datamodel.IACConfig.
IACConfigStore-Interface
With the IACConfigStore interface you can save and read all (even complex) data for objects that are linked to one another. IACConfigStore implement entity framework classes that represent a so-called application context (e.g. production orders, parts lists, purchase orders ...). An application context is a group of semantically related tables , one table being the so-called " main table ".
A simple example of an application context would be the tables "order header" and "order items" which are in a "1: N relationship". The "order header" table would be the "main table" for which the configuration data is saved.
The entity class, which represents the " main table " in a group of semantically linked tables, must implement the IACConfigStore interface . In our example this would be the "Order header" table. Other tables within this group can also implement IACConfigStore if they want to store additional data for themselves. The following entity classes implement this interface in the iPlus framework and iPlus-MES: ACClass, ACClassDesign, ACClassMethod, ACClassProperty, ACProgram, Material, MaterialWF, Partslist, ProdOrderPartslist.
The most important property of the IACConfigStore interface is ConfigurationEntries:
IEnumerable<IACConfig> ConfigurationEntries { get; }
This enumerator returns all configuration entries that are stored under the main table. Configuration entries are entity classes that implement the IACConfig interface.
IACConfig-Interface
The IACConfig interface enables reading and saving of configuration values .
Configuration values can be saved not only for the main table (the EF class that implements the IACConfigStore interface), but also for all other tables within the same application context. In order to address sub-table or a relationship between one or more entities to be described is ACUrl used. ACUrl's can not only be used for living ACComponent instances , but entity objects (table entries ) can also be addressed. The interface provides the properties for this purpose KeyACUrl, PreConfigACUrl, LocalConfigACUrl ready.
Do not define too many tables that implement IACConfig. We recommend a configuration table for each main table (e.g. for production orders, parts lists, purchase orders ...).
Member of IACConfig
Name | description |
---|
string KeyACUrl | You use the KeyACUrl property to address another subtable or ACComponent. The URL is either absolute or relative to the "main table" . Technically, "relative" means that each configuration table uses a foreign key to refer to an entry in its main table and the ACUrl is then relative to it. If the KeyACUrl is empty or zero , this means that it is a configuration for the main table itself . Examples: a.) There is a main table Material which implements IACConfigStore and a configuration table MaterialConfig which implements IACConfig. In the foreign key field "MaterialID" the MaterialConfig refers to a material X from the main table. The KeyACUrl contains ". \ Materialcalculation (4711)". This means that a configuration has been saved for the material calculation sub-table that applies to material X in combination with MaterialCalculationNo 4711. b.) A KeyACUrl can also contain a "Live-ACUrl" for an instance from an application structure. eg "\ Mixery \ WeigherA \ Motor". The KeyACUrl is set automatically when the configuration is added via the IACConfigStore.NewACConfig () method , since IACConfigStore.ACConfigKeyACUrl itself returns this relative URL. Main tables return a null string as ACConfigKeyACUrl. Sub-tables Your relative URL to the main table. If the entity class Materialcalculation implements the interface IACConfigStore, then the IACConfigStore.ACConfigKeyACUrl would return ". \ Materialcalculation (4711)" for material X.
For a relationship between two or more objects, use the OR operator " || " ("ACUrlHelper.Delimiter_Relationship") to separate additional ACUrls. z.B. "ACClass(Mixery)\ACClass(HopperscaleTypeA1)\PAPointMatOut1|| ACClass(Mixery)\ACClass(Mixer)\PAPointMatIn1". |
---|
string LocalConfigACUrl | LocalConfigACUrl refers to a property that is relative to the object specified by KeyACUrl. It can also be used for something else if you program some custom logic. In most cases, LocalConfigACUrl is used to address properties of ACMethods (virtual methods) in workflows or their configuration properties. e.g. "MixeryDef \ Mixer (0) \ Dosing (0) \ SMStarting \ SkipComponents" or "MixeryDef \ Mixer (0) \ Dosing (0) \ Dosing \ FlowRate1" |
---|
string PreConfigACUrl | Calling sub-workflows is similar to calling a subroutine. When calling subroutines, parameters must be passed that apply specifically to this call. If the same subroutine is called by another program, other parameters must be passed. This is also the case with workflows. If you want to define other parameters for the sub-workflow, you need to know from where the sub-workflow was called. This is saved in this property. |
---|
string ConfigACUrl | Complete url. Combination of PreConfigACUrl + LocalConfigACUrl. |
---|
Guid ? VBiACClassID | Reference to a class from the iPlus type system. |
---|
Guid ? ACClassWFID | Reference to a workflow node (definition - not runtime!). |
---|
IACConfigStore ConfigStore | Reference to the IACConfigStore. |
---|
object Value | The actual configuration value. The property is inherited from the interface IACContainer . |
---|
Name | description |
---|
IEnumerable<IACConfig> ConfigurationEntries | A thread-safe and cached list of configuration entries of type IACConfig. Important: caching!Please note that configuration values are cached. Call the ClearCacheOfConfigurationEntries () method explicitly to reset the cache and force a reload from the database. |
---|
string ACConfigKeyACUrl | ACConfigKeyACUrl returns the relative url to the "main table". This property is used when NewACConfig () is called. NewACConfig () creates a new IACConfig instance and sets the IACConfig.KeyACUrl property with this ACConfigKeyACUrl. |
---|
IACConfig NewACConfig(...) | Creates and adds an IACConfig instance to ConfigurationEntries . Technical: The implementing class creates a new entity object and adds it to its associated configuration table. With this call, the IACConfig.KeyACUrl property is assigned the ACConfigKeyACUrl property. |
---|
void RemoveACConfig(...) | Removes a configuration from ConfigurationEntries and the database context. |
---|
decimal OverridingOrder | The same configuration value (saved in "IACConfig.Value") can be saved in different config tables that build on each other. We call this scenario "configuration parameter overwriting" or the principle of "strict entity separation as the process progresses". This property defines the "superordinate order". This parameter cannot be saved and is automatically recalculated by classes that implement the IACConfigProvider interface (ConfigManagerIPlus and ConfigManagerIPlusMES). More on this in the next chapter . |
---|