@@ -488,6 +488,11 @@ public static int changeData(string json, EventData eventData, AdminShellPackage
488
488
}
489
489
if ( referable is SubmodelElementList sml )
490
490
{
491
+ if ( sml . Value == null )
492
+ {
493
+ sml . Value = new List < ISubmodelElement > ( ) ;
494
+ }
495
+ data = sml . Value ;
491
496
children = sml . Value ;
492
497
}
493
498
var r = referable ;
@@ -726,11 +731,15 @@ public static int changeSubmodelElement(EventData eventData, EventPayloadEntry e
726
731
727
732
if ( maxCount != 0 && eventData . dataCollection == parent )
728
733
{
729
- SubmodelElementCollection data = eventData . dataCollection ;
734
+ SubmodelElementCollection data = null ;
735
+ if ( eventData . dataCollection is SubmodelElementCollection dataSmc )
736
+ {
737
+ data = dataSmc ;
738
+ }
730
739
// if (eventData.direction != null && eventData.direction.Value == "IN" && eventData.mode != null && (eventData.mode.Value == "PUSH" || eventData.mode.Value == "PUT"))
731
- if ( eventData . direction != null && eventData . direction . Value == "IN" && eventData . mode != null )
740
+ if ( data != null && eventData . direction != null && eventData . direction . Value == "IN" && eventData . mode != null )
732
741
{
733
- if ( eventData . dataCollection . Value != null && eventData . dataCollection . Value . Count == 1 && eventData . dataCollection . Value [ 0 ] is SubmodelElementCollection smc )
742
+ if ( data . Value != null && data . Value . Count == 1 && data . Value [ 0 ] is SubmodelElementCollection smc )
734
743
{
735
744
data = smc ;
736
745
@@ -767,7 +776,7 @@ public class EventData
767
776
public AasCore . Aas3_0 . Property changes = null ;
768
777
public AasCore . Aas3_0 . Property endPoint = null ;
769
778
public Submodel dataSubmodel = null ;
770
- public SubmodelElementCollection dataCollection = null ;
779
+ public ISubmodelElement dataCollection = null ;
771
780
public AasCore . Aas3_0 . Property dataMaxSize = null ;
772
781
public SubmodelElementCollection statusData = null ;
773
782
public AasCore . Aas3_0 . Property noPayload = null ;
@@ -829,12 +838,14 @@ public static Operation FindEvent(ISubmodel submodel, ISubmodelElement sme, stri
829
838
public void ParseData ( Operation op , AdminShellPackageEnv env )
830
839
{
831
840
SubmodelElementCollection smec = null ;
841
+ SubmodelElementList smel = null ;
832
842
Submodel sm = null ;
833
843
AasCore . Aas3_0 . Property p = null ;
834
844
835
845
foreach ( var input in op . InputVariables )
836
846
{
837
- smec = null ;
847
+ smec = null ;
848
+ smel = null ;
838
849
sm = null ;
839
850
p = null ;
840
851
var inputRef = input . Value ;
@@ -851,6 +862,10 @@ public void ParseData(Operation op, AdminShellPackageEnv env)
851
862
{
852
863
smec = ( inputRef as SubmodelElementCollection ) ;
853
864
}
865
+ if ( inputRef is SubmodelElementList )
866
+ {
867
+ smel = ( inputRef as SubmodelElementList ) ;
868
+ }
854
869
855
870
if ( inputRef is ReferenceElement )
856
871
{
@@ -859,6 +874,10 @@ public void ParseData(Operation op, AdminShellPackageEnv env)
859
874
{
860
875
smec = refElement as SubmodelElementCollection ;
861
876
}
877
+ if ( refElement is SubmodelElementList )
878
+ {
879
+ smel = refElement as SubmodelElementList ;
880
+ }
862
881
if ( refElement is Submodel )
863
882
{
864
883
sm = refElement as Submodel ;
@@ -913,6 +932,8 @@ public void ParseData(Operation op, AdminShellPackageEnv env)
913
932
dataSubmodel = sm ;
914
933
if ( smec != null )
915
934
dataCollection = smec ;
935
+ if ( smel != null )
936
+ dataCollection = smel ;
916
937
break ;
917
938
case "datamaxsize" :
918
939
if ( p != null )
0 commit comments