Skip to content

Commit 48a9530

Browse files
committed
Add missing content to Migration Guide
- [x] Add missing `IOrderManagement` API changes - [x] Add missing code snippets for Mqtt Driver - [x] Add missing namespace change note for `Moryx.Drivers.Mqtt.Topics` - [x] Add missing Resource Initializer change note - [x] Update migration guide for v4_to_ControlSystem6.md after issues with current product migrations
1 parent c0108b0 commit 48a9530

File tree

2 files changed

+57
-20
lines changed

2 files changed

+57
-20
lines changed

docs/migrations/v4_to_ControlSystem6.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ In case you used any of these `Create()` functions, please update your code by
6868
using ef core's `DbContext`. As an example for `IActivitiyEntityRepository` the
6969
changes could look like this:
7070

71-
```
71+
````csharp
7272
// before
7373
var activityEntity = uow.GetRepository<IActivityEntityRepository>().Create(activityData.Task.Id, activityData.Resource.Id);
7474
activityEntity.ProcessId = processData.Id;
@@ -82,7 +82,7 @@ changes could look like this:
8282
ResourceId = activityData.Resource.Id,
8383
ProcessId = processData.Id,
8484
}).Entity;
85-
85+
``
8686

8787
### MORYX Machine Connector
8888
```sql
@@ -310,8 +310,8 @@ ALTER INDEX "PartLink_IX_ChildId" RENAME TO "IX_PartLinks_ChildId";
310310
ALTER INDEX "PartLink_IX_ParentId" RENAME TO "IX_PartLinks_ParentId";
311311

312312
ALTER TABLE public."ProductFileEntity" RENAME TO "ProductFiles";
313-
ALTER TABLE public."PartLinks" RENAME CONSTRAINT "PK_public.ProductFileEntity" TO "PK_ProductFiles";
314-
ALTER TABLE public."PartLinks" RENAME CONSTRAINT "FK_public.ProductFileEntity_public.ProductTypeEntity_Product_Id" TO "FK_ProductFiles_ProductTypes_ProductId";
313+
ALTER TABLE public."ProductFiles" RENAME CONSTRAINT "PK_public.ProductFileEntity" TO "PK_ProductFiles";
314+
ALTER TABLE public."ProductFiles" RENAME CONSTRAINT "FK_public.ProductFileEntity_public.ProductTypeEntity_Product_Id" TO "FK_ProductFiles_ProductTypes_ProductId";
315315
ALTER INDEX "ProductFileEntity_IX_Product_Id" RENAME TO "IX_ProductFiles_ProductId";
316316

317317
ALTER TABLE public."ProductInstanceEntity" RENAME TO "ProductInstances";
@@ -346,8 +346,8 @@ ALTER TABLE public."StepEntity" RENAME TO "WorkplanSteps";
346346
ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "PK_public.StepEntity" TO "PK_WorkplanSteps";
347347
ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "FK_public.StepEntity_public.WorkplanEntity_SubWorkplanId" TO "FK_WorkplanSteps_Workplans_SubWorkplanId";
348348
ALTER TABLE public."WorkplanSteps" RENAME CONSTRAINT "FK_public.StepEntity_public.WorkplanEntity_WorkplanId" TO "FK_WorkplanSteps_Workplans_WorkplanId";
349-
ALTER INDEX "ProductTypeEntity_IX_CurrentVersionId" RENAME TO "IX_WorkplanSteps_WorkplanId";
350-
ALTER INDEX "ProductTypeEntity_Identifier_Revision_Index" RENAME TO "IX_WorkplanSteps_SubWorkplanId";
349+
ALTER INDEX "StepEntity_IX_WorkplanId" RENAME TO "IX_WorkplanSteps_WorkplanId";
350+
ALTER INDEX "StepEntity_IX_SubWorkplanId" RENAME TO "IX_WorkplanSteps_SubWorkplanId";
351351
ALTER TABLE public."WorkplanSteps" ADD COLUMN "PositionX" float8 NOT NULL;
352352
ALTER TABLE public."WorkplanSteps" ADD COLUMN "PositionY" float8 NOT NULL;
353353

@@ -369,7 +369,7 @@ CREATE TABLE public."__EFMigrationsHistory" (
369369
);
370370
ALTER TABLE public."__EFMigrationsHistory" OWNER TO postgres;
371371
INSERT INTO public."__EFMigrationsHistory"("MigrationId", "ProductVersion")
372-
VALUES ('20211104134724_InitialCreate', '3.1.0');
372+
VALUES ('20220906133824_InitialCreate', '8.0.12');
373373
ALTER TABLE ONLY public."__EFMigrationsHistory"
374374
ADD CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId");
375375

docs/migrations/v8_to_v10.md

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,9 @@ The analytics module was doing nothing and the web module was replaced by suppor
416416
### Module Orders
417417

418418
- 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.
419-
- Facade Renaming:
420-
- `GetOperationAsync` -> `LoadOperationAsync`
419+
- `void InterruptOperation(Operation operation, OperationReport report);` -> `Task InterruptOperationAsync(Operation operation, User user, CancellationToken cancellationToken = default);`
420+
- `event EventHandler<OperationReportEventArgs> OperationInterrupted;` -> `event EventHandler<OperationChangedEventArgs> OperationInterrupted;`
421+
- Allowing more changes on a created operation before starting it.
421422
- `SetOperationSortOrder` and `UpdateSource` were combined to `UpdateOperationAsync`. It supports both functionalities and included changing `PlannedStart` and `PlannedEnd` as well.
422423

423424
#### Async Lifecycle Support for OrderManagement
@@ -460,7 +461,7 @@ Additionally, the APIs of these components have been updated to return `Task` or
460461

461462
**`IOrderManagement`-facade:**
462463

463-
- `Operation GetOperation` -> `Task<Operation> GetOperationAsync`
464+
- `Operation GetOperation` -> `Task<Operation> LoadOperationAsync`
464465
- `Operation AddOperation` -> `Task<Operation> AddOperationAsync`
465466
- `void BeginOperation` -> `Task BeginOperationAsync`
466467
- `void AbortOperation` -> `Task AbortOperationAsync`
@@ -516,6 +517,7 @@ Additionally, the APIs of these components have been updated to return `Task` or
516517
- The initializers are registered transient by default.
517518
- It is subject to the [#async-life-cycle](#async-life-cycle) changes.
518519
- Introduced `ResourceInitializerResult` object for extensibility and option to save
520+
- 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.
519521

520522
<details>
521523
<summary> Code Replacement Snippets </summary>
@@ -691,22 +693,57 @@ This is part of the unification of the general [data model changes](#data-model-
691693

692694
Bugfixes:
693695

694-
* The change in ConnectingToBrokerState prevents an application crash that were not uncommon during debugging
696+
- The change in ConnectingToBrokerState prevents an application crash that were not uncommon during debugging
695697

696698
Cleanup:
697699

698-
* Mostly typos in the string resources or non equal punctuation
699-
* Don't use the obsolete Payload Method and use ReadOnlySequence instead. To avoid unnecessary array copies methods deserializing the data have breaking signature changes
700-
* Remove Newtonoft.Json in favor of System.Text.Json
700+
- Mostly typos in the string resources or non equal punctuation
701+
- Don't use the obsolete Payload Method and use ReadOnlySequence instead. To avoid unnecessary array copies methods deserializing the data have breaking signature changes
702+
<details>
703+
<summary> Code Replacement Snippets </summary>
704+
705+
```csharp
706+
Deserialize(byte[] messageAsBytes) // replace with
707+
Deserialize(ReadOnlySequence<byte> messageAsBytes)
708+
```
709+
</details>
710+
- Remove Newtonoft.Json in favor of System.Text.Json
711+
- Move namespace `Moryx.Drivers.Mqtt.MqttTopics` to `Moryx.Drivers.Mqtt.Topics`
701712

702713
Features:
703714

704-
* Add the option to add custom topics as the User by removing internal access modifiers from MqttTopic Serialize and Deserialize
705-
* Add Retain information for Publishing and Receiving messages
706-
* Support Mqtt5 response topics
707-
* Support unsubscribing from Topics, by removing or changing the resource
708-
* Support changing the broker without restarting the Resource Management, by a) providing a Reconnect method and b) handling changes to the relevant properties
709-
* Support diagnostic tracing of message contents, before and after deserialization
715+
- Add the option to add custom topics as the User by removing internal access modifiers from MqttTopic Serialize and Deserialize
716+
- Add Retain information for Publishing and Receiving messages
717+
- Support Mqtt5 response topics
718+
- Support unsubscribing from Topics, by removing or changing the resource
719+
- Support changing the broker without restarting the Resource Management, by a) providing a Reconnect method and b) handling changes to the relevant properties
720+
- Support diagnostic tracing of message contents, before and after deserialization
721+
722+
#### Required SQL Update:
723+
724+
````sql
725+
// SQLite
726+
UPDATE Resources
727+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicIByteSerializable'
728+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicIByteSerializable';
729+
UPDATE Resources
730+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicJson'
731+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicJson';
732+
UPDATE Resources
733+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicPrimitive'
734+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicPrimitive';
735+
736+
// PostgreSQL
737+
UPDATE public."Resources"
738+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicIByteSerializable '
739+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicIByteSerializable ';
740+
UPDATE public."Resources"
741+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicJson'
742+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicJson';
743+
UPDATE public."Resources"
744+
SET "Type" = 'Moryx.Drivers.Mqtt.Topics.MqttTopicPrimitive'
745+
WHERE "Type" = 'Moryx.Drivers.Mqtt.MqttTopics.MqttTopicPrimitive';
746+
````
710747

711748
### OPC-UA Driver`
712749

0 commit comments

Comments
 (0)