⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlflow.js

📁 一个用javascript实现的工作流定义工具
💻 JS
字号:
function parseXML(xml)
{
	if(xml != '')
	{
		var xmlRoot = new Xparse(xml);

		var flowObj = xmlRoot.contents[0];

		var cfgObj = flowObj.contents[0];     //
		var stpObj = flowObj.contents[1];     //
		var actObj = flowObj.contents[2];     // 

		var tmpObj = cfgObj.contents[0]; 
		var flowId = tmpObj.attributes['flowId'];
		var flowText = tmpObj.attributes['flowText'];

		var i = 0,num = 3;

		var id, text, type;
		for (i = 0; i < stpObj.contents.length; i++) 
		{
			var Step = stpObj.contents[i];
			var basep = Step.contents[0];
			id = basep.attributes["id"];
			text = basep.attributes["text"];	
			type = basep.attributes["stepType"];
			if (type == 'NormalStep')
			   type = 'normal';
			if (type == 'EndStep')
			   type = 'end';
			if (type == 'BeginStep')
			   type = 'start';

			var vml = Step.contents[1];
			var x, y;
			x = toInt(vml.attributes["x"]) / 3;
			y = toInt(vml.attributes["y"]) / 3;

			var stp = new FlowStep(x, y, id, text, type);
			flow.addStep(stp);
			stp.draw(flow.drawer);
		}

		for (i = 0;i < actObj.contents.length;i++)
		{
			var Action = actObj.contents[i];
			var basep = Action.contents[0];
			id = basep.attributes["id"];
			var from = flow.findStep(basep.attributes["from"]);
			var to = flow.findStep(basep.attributes["to"]);

			flow.newAction(from, to, id);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -