test/end_to_end/test_e2e_AnalogItem.js
/**
     * find the nodeId that matches  property  named 'browseName' on a given node
     * @param nodeId
     * @param browseName
     * @param callback
     */
find the nodeId that matches  property  named 'browseName' on a given node
@param nodeId
@param browseName
@param callback
find the nodeId that matches property named ' browseName ' on a given node @param nodeId @param browseName @param callback
function findProperty(g_session, nodeId, browseName, callback) {
        var browseDescription = {
            nodeId: nodeId,
            referenceTypeId: "HasProperty",
            browseDirection: BrowseDirection.Forward,
            resultMask: 0x3F
        };
        g_session.browse(browseDescription, function (err, result) {
            if (err) { return callback(err); }
            result = result[0];
            if (result.statusCode !== StatusCodes.Good) {
                return callback(null, null);
            }
            var tmp = _.filter(result.references, function (e) {
                console.log("     ", e.nodeId.toString(), e.browseName.name.yellow);
                return e.browseName.name === browseName;
            });
            tmp = tmp.map(function (e) {
                return e.nodeId;
            });
            var found = (tmp.length === 1) ? tmp[0] : null;
            callback(null, found);
        });
    }
function findProperty ( g_session , nodeId , browseName , callback ) { var browseDescription = { nodeId : nodeId , referenceTypeId : "HasProperty" , browseDirection : BrowseDirection . Forward , resultMask : 0x3F } ; g_session . browse ( browseDescription , function ( err , result ) { if ( err ) { return callback ( err ) ; } result = result [ 0 ] ; if ( result . statusCode !== StatusCodes . Good ) { return callback ( null , null ) ; } var tmp = _ . filter ( result . references , function ( e ) { console . log ( "     " , e . nodeId . toString ( ) , e . browseName . name . yellow ) ; return e . browseName . name === browseName ; } ) ; tmp = tmp . map ( function ( e ) { return e . nodeId ; } ) ; var found = ( tmp . length === 1 ) ? tmp [ 0 ] : null ; callback ( null , found ) ; } ) ; }
find the nodeId that matches  property  named 'browseName' on a given node
 @param nodeId
 @param browseName
 @param callback
find the nodeId that matches property named ' browseName ' on a given node @param nodeId @param browseName @param callback