Skip to content

ProgramStateMachineState has wrong InitializationString and possible many other classes also #3770

Open

Description

@Hevgen

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

Call to Create() on an instance of ProgramStateMachineState (or its successor) causes adding wrong child nodes to it. It adds children of ProgramStateMachineType which do not have any ModellingRule (nor Optional, nor Mandatory).

Expected Behavior

Call to Create() on an instance of ProgramStateMachineState (or its successor) should add child nodes according to the Specification: having reference HasModellingRule to Mandatory or Optional. (Not sure that optional children should be added by default).

Steps To Reproduce

During a debugging I had found out that wrong children appeared after call to Initialize() inside Create() call chain.

Image

The screenshot of debugging clearly shows "Suspended" node adding in Initialize() call (during decoding of binary data in InitializationString). "Suspended" is node representing possible program state and do not have any ModellingRule.

Environment

- OS:Windows 11
- Environment:
- Runtime: Visual Studio 2026 18.5.2
- Nuget Version: 1.5.378.134
- Component: OPCFoundation.NetStandard.Opc.Ua / Opc.Ua.Core
- Server: custom

Anything else?

Possible the same issue (adding children without ModellingRule to instances) exists for many other generated classes because InitializationString is generated by the same logic from xml, as I understand.

It is not clear for me: is this issue related to UA-ModelCompiler or is generation of the classes completelly implemented inside UA-.NETStandard now. Should I add issue to UA-ModelCompiler based on current one?

Activity

  1. added
    bug
    on May 15, 2026
  2. romanett commented on May 24, 2026

    @romanett
    Contributor

    Starting with Version 1.6 a Source Generator located in this repository is used and no initializations strings are needed any more. For Version 1.5.378, this needs be fixed in the Model Compiler.

  3. added
    1.5.378
    on Jun 5, 2026
  4. added a commit that references this issue on Jun 17, 2026
    00519fa
  5. added
    codegen
    on Jul 23, 2026
  6. modified the milestones: 2.0, 2.1 on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1.5.378bugcodegen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions