changing a reference property

I’m trying to setup a system where I can change a single reference property (like a polygon outline color) and get all the objects referencing that property to see the change. I got this working using javascript but haven’t figured it out for czml processing. It looks like I’m not processing the czml such that the reference entity gets updated. Suggestions? Here’s sandcastle code:
var viewer = new Cesium.Viewer(‘cesiumContainer’);

var czml = [{

"id" : "document",

"name" : "CZML Reference Properties",

"version" : "1.0"

}, {

"id" : "scan-dummy-ref",

"name" : "dummy objects for referencing properties",

"show" : false,

"polygon" : {

    "show": false,

    "outlineColor" : {

        "rgba" : [255, 0, 0, 255]

    },

    "outlineWidth" : 5

}

}, {

"id" : "polygon",

"name" : "Referencing Color",

"polygon" : {

    "positions" : {

        "cartographicDegrees" : [

            -115.0, 37.0, 0,

            -115.0, 32.0, 0,

            -107.0, 33.0, 0,

            -102.0, 31.0, 0,

            -102.0, 35.0, 0

        ]

    },

    "height": 0,

    "outline" : true,

    "outlineColor" : {

        "reference" : "scan-dummy-ref#polygon.outlineColor"

    },

    "outlineWidth" : "scan-dummy-ref#polygon.outlineWidth"

}

}];

var czmlsource = new Cesium.CzmlDataSource();

viewer.dataSources.add(czmlsource);

czmlsource.load(czml);

function changePolygonWhite() {

console.log("Toggle polygon outline to white.");

var czmlUpdate = [{

    "id" : "scan-dummy-ref",

    "outlineColor" : {

        "rgba" : [255, 255, 255, 255]

    }

}];

czmlsource.process(czmlUpdate).then(function(ds){

    var scanRef = ds.entities.getById("scan-dummy-ref");

    console.log(scanRef.polygon.outlineColor.getValue(0));

});

}

function changePolygonBlack() {

console.log("Toggle polygon outline to black.");

var czmlUpdate = [{

    "id" : "scan-dummy-ref",

    "outlineColor" : {

        "rgba" : [0, 0, 0, 255]

    }

}];

czmlsource.process(czmlUpdate).then(function(ds){

    var scanRef = ds.entities.getById("scan-dummy-ref");

    console.log(scanRef.polygon.outlineColor.getValue(0));

});

}

function dummyFunction() {

//Sandcastle.declare(dummyFunction);

}

Sandcastle.addToolbarMenu([{

text : 'Dummy function',

onselect : function() {

    dummyFunction();

    Sandcastle.highlight(dummyFunction);

}

},{

text : 'Change polygon white',

onselect : function() {

    changePolygonWhite();

    Sandcastle.highlight(changePolygonWhite);

}

},{

text : 'Change polygon black',

onselect : function() {

    changePolygonBlack();

    Sandcastle.highlight(changePolygonBlack);

}

}]);

Sandcastle.reset = function () {

};

``

Here’s the sandcastle code for doing it from within the script in case anyone’s curious:
var viewer = new Cesium.Viewer(‘cesiumContainer’);

var czml = [{

“id” : “document”,

“name” : “CZML Reference Properties”,

“version” : “1.0”

}, {

“id” : “scan-dummy-ref”,

“name” : “dummy objects for referencing properties”,

“show” : false,

“polygon” : {

“show”: false,

“outlineColor” : {

“rgba” : [255, 0, 0, 255]

},

“outlineWidth” : 5

}

}, {

“id” : “polygon”,

“name” : “Referencing Color”,

“polygon” : {

“positions” : {

“cartographicDegrees” : [

-115.0, 37.0, 0,

-115.0, 32.0, 0,

-107.0, 33.0, 0,

-102.0, 31.0, 0,

-102.0, 35.0, 0

]

},

“height”: 0,

“outline” : true,

“outlineColor” : {

“reference” : “scan-dummy-ref#polygon.outlineColor”

},

“outlineWidth” : 5

}

}];

var scanRef, testPolygon;

viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)).then(function(ds){

scanRef = ds.entities.getById(“scan-dummy-ref”);

});

function changePolygonWhite() {

//Sandcastle.declare(togglePolygonColor);

scanRef.polygon.outlineColor = Cesium.Color.WHITE;

console.log(“Toggle polygon outline to white.”);

}

function changePolygonBlack() {

//Sandcastle.declare(togglePolygonColor);

scanRef.polygon.outlineColor = Cesium.Color.BLACK;

console.log(“Toggle polygon outline to black.”);

}

function dummyFunction() {

//Sandcastle.declare(dummyFunction);

}

Sandcastle.addToolbarMenu([{

text : ‘Change polygon white’,

onselect : function() {

console.log(“Change polygon white toolbar called.”);

changePolygonWhite();

Sandcastle.highlight(changePolygonWhite);

}

},{

text : ‘Change polygon black’,

onselect : function() {

console.log(“Change polygon black toolbar called.”);

changePolygonBlack();

Sandcastle.highlight(changePolygonBlack);

}

}]);

Sandcastle.reset = function () {

};

``

I figured it out. I was scoping the reference property incorrectly. Instead of:
var czmlUpdate = [{

   "id" : "scan-dummy-ref",

   "outlineColor" : {

       "rgba" : [255, 255, 255, 255]

   }

}];

``

I needed:

var czmlUpdate = [{

“id” : “scan-dummy-ref”,

“polygon” : {

“outlineColor” : {

“rgba” : [0, 0, 0, 255]

}

}

}];

``