/// class PD.Manage.Modules.ObjectModel.ProcessNodeContextMenu
// using PD.Web.UI.Controls.ContextMenuSegment

PD.Manage.Modules.ObjectModel.ProcessNodeContextMenu =
PD.Web.UI.Controls.ContextMenuSegment.extend({

    //===================================
    // EVENT HANDLERS
    //===================================

    onRegisterItems: function (e) {

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/process-model/context-menu:process-node/create"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/process-model/context-menu:process-node/delete"
        }));

    },

    onOpen: function (e) {

        var tree = this.get_context()["tree"],
            item = tree.dataItem(e.target);

        PD.context.get_default().get_commands().setState({
            "pd/process-model/context-menu": {
                processId: item.processId,
                nodeId: item.id,
                nodeName: item.name,
                nodeRole: item.role,
                nodeType: item.type
            }
        });

    }

});