heisenbergs-uncertainty commented on issue #3632:
URL: https://github.com/apache/streampipes/issues/3632#issuecomment-2941101864
> Thanks for your detailed description!
> There were indeed some changes we did in addition to the NamingStrategy
that were meant to extend the set of supported OPC-UA types (ExtensionObjects
and some other Basic Data Types). But it seems something is broken/unsupported
here.
> Since it's hard for me to reproduce, let's find a solution together ;-)
>
> Currently we do the following:
> For each selected node, we check if the type is a
``BaseDataVariableTypeNode``.
>
> ```java
> if (node instanceof BaseDataVariableTypeNode) {
> var nodeInfo = new BasicVariableNodeInfo((BaseDataVariableTypeNode)
node, spOpcConfig.getNamingStrategy());
> return OpcUaNodeFactory.createOpcUaNode(nodeInfo,
runtimeNamesToDelete);
> }
>
> throw new UaException(StatusCode.BAD, "Node is not of type
BaseDataVariableTypeNode");
> }
> ```
>
> The exception thrown here looks similar to your first error message so I
think the node has a type that can not be assigned to BaseDatavariableTypeNode.
Do you have any insights which unsupported data type the node might have?
>
> If this part of the code succeeds, we check if the variable is a built-in
type or a extension object. For an extension object, we try to decode the value
so that it is properly parsed to a StreamPipes event.
>
> This is done by this snippet:
>
> ```java
> private Struct extractStruct(OpcUaClient client,
> Variant variant) {
> if (variant.getValue() instanceof ExtensionObject extensionObject) {
> var decoded =
extensionObject.decode(client.getDynamicSerializationContext());
> if (decoded instanceof Struct struct) {
> return struct;
> }
> }
> throw new SpRuntimeException("Decoded value is not a Struct");
> }
> ```
>
> It seems that the extension object cannot be properly decoded in your case.
> What do you think - should we add some more info to the Node Details
section and logging to understand what these unsupported data types are?
>
>
>
>
Im not 100% sure. I'm thinking that the issue is around poorly structured
Data Types. The vendor I work with created this OPC Server and custom
namespaces.
I will do some debugging locally this week and see if I can potentially
figure out what is going on. And either submit a PR or at least leave some more
detailed debugging info here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]