diff --git a/docs/migrations/v4_to_ControlSystem6.md b/docs/migrations/v4_to_ControlSystem6.md index 1b4b67bc0..b8c87513d 100644 --- a/docs/migrations/v4_to_ControlSystem6.md +++ b/docs/migrations/v4_to_ControlSystem6.md @@ -68,7 +68,7 @@ In case you used any of these `Create()` functions, please update your code by using ef core's `DbContext`. As an example for `IActivitiyEntityRepository` the changes could look like this: -``` +```csharp // before var activityEntity = uow.GetRepository().Create(activityData.Task.Id, activityData.Resource.Id); activityEntity.ProcessId = processData.Id; @@ -82,7 +82,7 @@ changes could look like this: ResourceId = activityData.Resource.Id, ProcessId = processData.Id, }).Entity; - +``` ### MORYX Machine Connector ```sql @@ -310,8 +310,8 @@ ALTER INDEX "PartLink_IX_ChildId" RENAME TO "IX_PartLinks_ChildId"; ALTER INDEX "PartLink_IX_ParentId" RENAME TO "IX_PartLinks_ParentId"; ALTER TABLE public."ProductFileEntity" RENAME TO "ProductFiles"; -ALTER TABLE public."PartLinks" RENAME CONSTRAINT "PK_public.ProductFileEntity" TO "PK_ProductFiles"; -ALTER TABLE public."PartLinks" RENAME CONSTRAINT "FK_public.ProductFileEntity_public.ProductTypeEntity_Product_Id" TO "FK_ProductFiles_ProductTypes_ProductId"; +ALTER TABLE public."ProductFiles" RENAME CONSTRAINT "PK_public.ProductFileEntity" TO "PK_ProductFiles"; +ALTER TABLE public."ProductFiles" RENAME CONSTRAINT "FK_public.ProductFileEntity_public.ProductTypeEntity_Product_Id" TO "FK_ProductFiles_ProductTypes_ProductId"; ALTER INDEX "ProductFileEntity_IX_Product_Id" RENAME TO "IX_ProductFiles_ProductId"; ALTER TABLE public."ProductInstanceEntity" RENAME TO "ProductInstances"; @@ -346,8 +346,8 @@ ALTER TABLE public."StepEntity" RENAME TO "WorkplanSteps"; ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "PK_public.StepEntity" TO "PK_WorkplanSteps"; ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "FK_public.StepEntity_public.WorkplanEntity_SubWorkplanId" TO "FK_WorkplanSteps_Workplans_SubWorkplanId"; ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "FK_public.StepEntity_public.WorkplanEntity_WorkplanId" TO "FK_WorkplanSteps_Workplans_WorkplanId"; -ALTER INDEX "ProductTypeEntity_IX_CurrentVersionId" RENAME TO "IX_WorkplanSteps_WorkplanId"; -ALTER INDEX "ProductTypeEntity_Identifier_Revision_Index" RENAME TO "IX_WorkplanSteps_SubWorkplanId"; +ALTER INDEX "StepEntity_IX_WorkplanId" RENAME TO "IX_WorkplanSteps_WorkplanId"; +ALTER INDEX "StepEntity_IX_SubWorkplanId" RENAME TO "IX_WorkplanSteps_SubWorkplanId"; ALTER TABLE public."WorkplanSteps" ADD COLUMN "PositionX" float8 NOT NULL; ALTER TABLE public."WorkplanSteps" ADD COLUMN "PositionY" float8 NOT NULL; @@ -369,7 +369,7 @@ CREATE TABLE public."__EFMigrationsHistory" ( ); ALTER TABLE public."__EFMigrationsHistory" OWNER TO postgres; INSERT INTO public."__EFMigrationsHistory"("MigrationId", "ProductVersion") -VALUES ('20211104134724_InitialCreate', '3.1.0'); +VALUES ('20220906133824_InitialCreate', '8.0.12'); ALTER TABLE ONLY public."__EFMigrationsHistory" ADD CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId"); diff --git a/docs/migrations/v8_to_v10.md b/docs/migrations/v8_to_v10.md index 68629fa7f..e52128d1a 100644 --- a/docs/migrations/v8_to_v10.md +++ b/docs/migrations/v8_to_v10.md @@ -416,8 +416,9 @@ The analytics module was doing nothing and the web module was replaced by suppor ### Module Orders - Removed report from interrupt of an operation. Reporting during an interruption doesn't add any value. The quantity for the report can only be predicted and will be inaccurate if something goes wrong or is reworked during the interruption. -- Facade Renaming: - - `GetOperationAsync` -> `LoadOperationAsync` + - `void InterruptOperation(Operation operation, OperationReport report);` -> `Task InterruptOperationAsync(Operation operation, User user, CancellationToken cancellationToken = default);` + - `event EventHandler OperationInterrupted;` -> `event EventHandler OperationInterrupted;` +- Allowing more changes on a created operation before starting it. - `SetOperationSortOrder` and `UpdateSource` were combined to `UpdateOperationAsync`. It supports both functionalities and included changing `PlannedStart` and `PlannedEnd` as well. #### Async Lifecycle Support for OrderManagement @@ -460,7 +461,7 @@ Additionally, the APIs of these components have been updated to return `Task` or **`IOrderManagement`-facade:** -- `Operation GetOperation` -> `Task GetOperationAsync` +- `Operation GetOperation` -> `Task LoadOperationAsync` - `Operation AddOperation` -> `Task AddOperationAsync` - `void BeginOperation` -> `Task BeginOperationAsync` - `void AbortOperation` -> `Task AbortOperationAsync` @@ -516,6 +517,7 @@ Additionally, the APIs of these components have been updated to return `Task` or - The initializers are registered transient by default. - It is subject to the [#async-life-cycle](#async-life-cycle) changes. - Introduced `ResourceInitializerResult` object for extensibility and option to save + - A `ComponentNotFoundException` is thrown now, if an initializer is configured in the `Moryx.Resources.Management.ModuleConfig.json` but not found in the assembly load context. Check your configuration in this case.
Code Replacement Snippets @@ -691,22 +693,57 @@ This is part of the unification of the general [data model changes](#data-model- Bugfixes: -* The change in ConnectingToBrokerState prevents an application crash that were not uncommon during debugging +- The change in ConnectingToBrokerState prevents an application crash that were not uncommon during debugging Cleanup: -* Mostly typos in the string resources or non equal punctuation -* Don't use the obsolete Payload Method and use ReadOnlySequence instead. To avoid unnecessary array copies methods deserializing the data have breaking signature changes -* Remove Newtonoft.Json in favor of System.Text.Json +- Mostly typos in the string resources or non equal punctuation +- Don't use the obsolete Payload Method and use ReadOnlySequence instead. To avoid unnecessary array copies methods deserializing the data have breaking signature changes +
+ Code Replacement Snippets + + ```csharp + Deserialize(byte[] messageAsBytes) // replace with + Deserialize(ReadOnlySequence messageAsBytes) + ``` +
+- Remove Newtonoft.Json in favor of System.Text.Json +- Move namespace `Moryx.Drivers.Mqtt.MqttTopics` to `Moryx.Drivers.Mqtt.Topics` Features: -* Add the option to add custom topics as the User by removing internal access modifiers from MqttTopic Serialize and Deserialize -* Add Retain information for Publishing and Receiving messages -* Support Mqtt5 response topics -* Support unsubscribing from Topics, by removing or changing the resource -* Support changing the broker without restarting the Resource Management, by a) providing a Reconnect method and b) handling changes to the relevant properties -* Support diagnostic tracing of message contents, before and after deserialization +- Add the option to add custom topics as the User by removing internal access modifiers from MqttTopic Serialize and Deserialize +- Add Retain information for Publishing and Receiving messages +- Support Mqtt5 response topics +- Support unsubscribing from Topics, by removing or changing the resource +- Support changing the broker without restarting the Resource Management, by a) providing a Reconnect method and b) handling changes to the relevant properties +- Support diagnostic tracing of message contents, before and after deserialization + +#### Required SQL Update: + +````sql +// SQLite +UPDATE Resources +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicIByteSerializable' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicIByteSerializable'; +UPDATE Resources +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicJson' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicJson'; +UPDATE Resources +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicPrimitive' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicPrimitive'; + +// PostgreSQL +UPDATE public."Resources" +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicIByteSerializable ' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicIByteSerializable '; +UPDATE public."Resources" +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicJson' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicJson'; +UPDATE public."Resources" +SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicPrimitive' +WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicPrimitive'; +```` ### OPC-UA Driver`