View Issue Details

IDProjectCategoryView StatusLast Update
0004133Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2019-07-18 15:12
ReporterHannes Mezger Assigned ToAlexander Allmendinger  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version8.1
Product Version1.03.340.380 
Target Version1.03Fixed in Version1.03.341.385 
Summary0004133: Monitored Item Services/Monitor Triggering/Err-011.js
Description

For SetTriggering, the server-assigned MonitoredItemId are used. Those IDs are not guaranteed to be unique in a session, only in the subscription:

Server-assigned id for the MonitoredItem (see 7.14 for IntegerId definition).
This id is unique within the Subscription, but might not be unique within the
Server or Session.

The test relies on the MonitoredItemIds of the two subscriptions to differ, but if a server returns the same ID for the items of the two subscriptions, the test fails while the server handles correctly.

Steps To Reproduce
  • Use Unified Automation AnsiC Demoserver 1.8.0
  • Enable following scripts of Monitored Item Services/Monitor Triggering:
    Err-006.js
    Err-007.js
    Err-010.js
    Err-011.js
  • Err-011.js fails with "SetTriggering().Response.AddResults[0] = Good (0x00000000) but BadMonitoredItemIdInvalid (0x80420000) was expected"
TagsNo tags attached.
Files Affected

Activities

Alexander Allmendinger

2019-02-01 23:26

developer   ~0009872

Script is now generating more monitoredItems to ensure the MonitoredItemIds are in a new range.

Hannes Mezger

2019-02-27 13:38

reporter   ~0009976

Issue is still present with 1.03.341.385

Hannes Mezger

2019-02-27 13:42

reporter   ~0009977

Our proposal for a fix:

if( CreateMonitoredItemsHelper.Execute( { SubscriptionId: FirstSubscription, ItemsToCreate: items[0] } ) ) {
    var tempItem0 = items[0].clone();
    tempItem0.MonitoredItemId = items[0].MonitoredItemId;
    // Now add 1 item (will be used as linksToAdd[]) to the second subscription
    CreateMonitoredItemsHelper.Execute( { SubscriptionId: SecondSubscription, ItemsToCreate: items } );
    var tempItems = [];
    for (var i = 0; i < items.length; i++) tempItems = items[i].clone();
    CreateMonitoredItemsHelper.Execute( { SubscriptionId: SecondSubscription, ItemsToCreate: tempItems } );

    var tempItem1 = items[1].clone();
    var tempItem2 = items[2].clone();

    if( CreateMonitoredItemsHelper.Execute( { SubscriptionId: SecondSubscription, ItemsToCreate: [ tempItem1, tempItem2] } ) ) {
        DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: items, SubscriptionId: SecondSubscription } );
        DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: tempItems, SubscriptionId: SecondSubscription } );
        DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: tempItem1, SubscriptionId: SecondSubscription } );
        // create the trigger and mix the items in both subscriptions (not allowed)
        SetTriggeringHelper.Execute( { SubscriptionId: FirstSubscription, TriggeringItemId: tempItem0, LinksToAdd: tempItem2, AddResults: new ExpectedAndAcceptedResults( StatusCode.BadMonitoredItemIdInvalid ) } );
        DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: tempItem2, SubscriptionId: SecondSubscription } );
    }
    DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: tempItem0, SubscriptionId: FirstSubscription } );
}

Previously, the second CreateMonitoredItemsHelper.Execute overwrites the content of items[0]. Now, items[0] is stored in tempItem0 and is used in the SetTriggeringHelper.Execute call.

Alexander Allmendinger

2019-03-18 00:33

developer   ~0010061

Agreed with proposed fix and fixed accordingly.

Paul Hunkar

2019-07-18 15:12

administrator   ~0010530

Reviewed in CMP call

Issue History

Date Modified Username Field Change
2018-01-22 17:58 Hannes Mezger New Issue
2018-01-22 17:58 Hannes Mezger Status new => assigned
2018-01-22 17:58 Hannes Mezger Assigned To => Alexander Allmendinger
2019-01-28 14:10 Paul Hunkar Category Script Issue => 1 - Script Issue
2019-02-01 23:26 Alexander Allmendinger Status assigned => resolved
2019-02-01 23:26 Alexander Allmendinger Resolution open => fixed
2019-02-01 23:26 Alexander Allmendinger Fixed in Version => 1.03.341.384
2019-02-01 23:26 Alexander Allmendinger Note Added: 0009872
2019-02-27 13:38 Hannes Mezger Status resolved => feedback
2019-02-27 13:38 Hannes Mezger Resolution fixed => reopened
2019-02-27 13:38 Hannes Mezger Note Added: 0009976
2019-02-27 13:42 Hannes Mezger Note Added: 0009977
2019-02-27 13:42 Hannes Mezger Status feedback => assigned
2019-03-18 00:33 Alexander Allmendinger Status assigned => resolved
2019-03-18 00:33 Alexander Allmendinger Resolution reopened => fixed
2019-03-18 00:33 Alexander Allmendinger Fixed in Version 1.03.341.384 => 1.03.341.385
2019-03-18 00:33 Alexander Allmendinger Note Added: 0010061
2019-07-18 15:12 Paul Hunkar Status resolved => closed
2019-07-18 15:12 Paul Hunkar Note Added: 0010530