nools.js
function NoolsFlowNode(n) {
		RED.nodes.createNode(this,n);
		var node = this;

		// node.messages contains all messages received by any assert node
		node.messages = {};
		node.clock = new Clock();

		var publish = function(msg) {
			node.emit("publish", msg);
		};

		node.flow = nools.compile(n.flow, {
			name: n.id,
			define: {
				Message: Message,
				Clock: Clock,
				publish: publish
			}
		});
		node.session = node.flow.getSession();
		node.session.assert(node.clock);

		//Run once for init
		node.session.match();

		node.on("close", function() {
			node.session.dispose();
			nools.deleteFlow(n.id);
		});

	}
function NoolsFlowNode(n) {
		RED.nodes.createNode(this,n);
		var node = this;

		// node.messages contains all messages received by any assert node
		node.messages = {};
		node.clock = new Clock();

		var publish = function(msg) {
			node.emit("publish", msg);
		};

		node.flow = nools.compile(n.flow, {
			name: n.id,
			define: {
				Message: Message,
				Clock: Clock,
				publish: publish
			}
		});
		node.session = node.flow.getSession();
		node.session.assert(node.clock);

		//Run once for init
		node.session.match();

		node.on("close", function() {
			node.session.dispose();
			nools.deleteFlow(n.id);
		});

	}
////////////////////////////////////////////////////////////////////////////// NoolsFlowNode: Configuration node containing the flow and session          // //////////////////////////////////////////////////////////////////////////////