本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发。。。

只是还是比較认真的做了三个月,老师非常认同我的工作态度和成果。。

实习立即就要结束了,总结一下几点之前没有注意过的变成习惯和问题。分享给大家。

同一时候打个广告:去哪网内审部招JavaWeb开发实习生,时间很自由。每周一天、周六周日甚至都能够,时间充裕的小伙伴给我留言啊,挣个零花钱,还能长点经验。

。。。(保研的、想工作的大四狗最合适只是了。。。

map的结构为(thisProcessID, thisProcessType;nextProcessID1,nextProcessType1;...;nextProcessIDk,nextProcessTypek;),假设processType部位start、end、split、join,则type和id同样。。。。

跑一下代码就知道是怎么回事了。直接上代码:

<span style="white-space:pre">	</span>public String XMLhead = "";	

	@SuppressWarnings({ "rawtypes", "unchecked" })
public void formXMLfile(Map nodeMap){
/*穿行没问题
nodeMap.put("1", "start;2,2");
nodeMap.put("2", "2;3,3");
nodeMap.put("3", "3;4,end");
nodeMap.put("4", "end");
*/
/* 简单并行没问题,但须要去重处理
nodeMap.put("1", "start;2,split");
nodeMap.put("2", "split;3,3;4,4");
nodeMap.put("3", "3;5,join");
nodeMap.put("4", "4;5,join");
nodeMap.put("5", "join;6,end");
nodeMap.put("6", "end");
*/ nodeMap.put("1", "start;2,split");
nodeMap.put("2", "split;3,3;4,split;5,5");
nodeMap.put("3", "3;6,6");
nodeMap.put("4", "split;7,7;8,8");
nodeMap.put("5", "5;9,join");
nodeMap.put("6", "6;9,join");
nodeMap.put("7", "7;10,join");
nodeMap.put("8", "8;10,join");
nodeMap.put("9", "join;11,end");
nodeMap.put("10", "join;9,join");
nodeMap.put("11", "end");
/*简单并行没问题。但须要去重处理
nodeMap.put("1", "start;2,split");
nodeMap.put("2", "split;3,3;4,4");
nodeMap.put("3", "3;5,join");
nodeMap.put("4", "4;5,join");
nodeMap.put("5", "join;6,split");
nodeMap.put("6", "split;7,7;8,8");
nodeMap.put("7", "7;9,join");
nodeMap.put("8", "8;9,join");
nodeMap.put("9", "join;10,end");
nodeMap.put("10", "end");
*/
XMLhead = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+"\n";
XMLhead += "<definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:activiti=\"http://activiti.org/bpmn\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\" typeLanguage=\"http://www.w3.org/2001/XMLSchema\" expressionLanguage=\"http://www.w3.org/1999/XPath\" targetNamespace=\"http://www.activiti.org/test\">"+"\n";
String XMLtail = "</definitions>";
XMLhead += "<process id=\"processID\" name=\"processNAME\" isExecutable=\"true\">"+"\n";
XMLtail = "</process>\n"+XMLtail; String this_id = "1";//start
String this_type = "start";
RECUformXMLfile(nodeMap, this_id, this_type);
String XMLfile = XMLhead + XMLtail; //去重
String[] temp = XMLfile.split("\n");
List<String> list = new LinkedList<String>();
for(int i = 0; i < temp.length; i++) {
if(!list.contains(temp[i])) {
list.add(temp[i]);//改为写文件
System.out.println(temp[i]);
}
}
} @SuppressWarnings("rawtypes")
public void RECUformXMLfile(Map nodeMap, String this_id, String this_type){
if(this_type.equals("start")){//start
String[] toNodes = nodeMap.get(this_id).toString().split(";");
String next_id = toNodes[1].split(",")[0];
String next_type = toNodes[1].split(",")[1];
if(next_type.equals("split")){
XMLhead += "<startEvent id=\"startevent1\" name=\"Start\"></startEvent>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"startevent1\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
} else if(next_type.equals("end_start_join")){//不可能 } else{//task
XMLhead += "<startEvent id=\"startevent1\" name=\"Start\"></startEvent>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"startevent1\" targetRef=\"task_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
}
} else if(this_type.equals("split")){//split
XMLhead += "<parallelGateway id=\"gateway_"+this_id+"\" name=\"Parallel Gateway\"></parallelGateway>"+"\n";
String[] toNodes = nodeMap.get(this_id).toString().split(";");
for(int i=1;i<toNodes.length;i++){
String next_id = toNodes[i].split(",")[0];
String next_type = toNodes[i].split(",")[1];
if(next_type.equals("split")){
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
} else if(next_type.equals("end_start_join")){//不可能 } else{//task
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"task_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
}
}
} else if(this_type.equals("end")){//不会出现,接下来的两个推断分支可能的next_type==end时,都已经处理 } else if(this_type.equals("join")){//join,join和task,两者处理逻辑一样,除了一个用gateWay。一个用task
String[] toNodes = nodeMap.get(this_id).toString().split(";");
String next_id = toNodes[1].split(",")[0];
String next_type = toNodes[1].split(",")[1];
if(next_type.equals("end")){
XMLhead += "<parallelGateway id=\"gateway_"+this_id+"\" name=\"Parallel Gateway\"></parallelGateway>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"endevent1\"></sequenceFlow>"+"\n";
XMLhead += "<endEvent id=\"endevent1\" name=\"End\"></endEvent>"+"\n";
return ;
} else if(next_type.equals("start")){//不可能 } else if(next_type.equals("split")){
XMLhead += "<parallelGateway id=\"gateway_"+this_id+"\" name=\"Parallel Gateway\"></parallelGateway>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
} else if(next_type.equals("join")){
XMLhead += "<parallelGateway id=\"gateway_"+this_id+"\" name=\"Parallel Gateway\"></parallelGateway>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
return ;
} else{//task
XMLhead += "<parallelGateway id=\"gateway_"+this_id+"\" name=\"Parallel Gateway\"></parallelGateway>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"gateway_"+this_id+"\" targetRef=\"task_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
}
} else{//task,task和join。两者处理逻辑一样。除了一个用gateWay。一个用task
String[] toNodes = nodeMap.get(this_id).toString().split(";");
String next_id = toNodes[1].split(",")[0];
String next_type = toNodes[1].split(",")[1];
if(next_type.equals("end")){
XMLhead += "<userTask id=\"task_"+this_id+"\" name=\""+this_id+"\"></userTask>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"task_"+this_id+"\" targetRef=\"endevent1\"></sequenceFlow>"+"\n";
XMLhead += "<endEvent id=\"endevent1\" name=\"End\"></endEvent>"+"\n";
return ;
} else if(next_type.equals("start")){//不可能 } else if(next_type.equals("split")){
XMLhead += "<userTask id=\"task_"+this_id+"\" name=\""+this_id+"\"></userTask>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"task_"+this_id+"\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
} else if(next_type.equals("join")){
XMLhead += "<userTask id=\"task_"+this_id+"\" name=\""+this_id+"\"></userTask>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"task_"+this_id+"\" targetRef=\"gateway_"+next_id+"\"></sequenceFlow>"+"\n";
//return ;
RECUformXMLfile(nodeMap, next_id, next_type);
} else{//task
XMLhead += "<userTask id=\"task_"+this_id+"\" name=\""+this_id+"\"></userTask>"+"\n";
XMLhead += "<sequenceFlow id=\"flow_"+this_id+"\" sourceRef=\"task_"+this_id+"\" targetRef=\"task_"+next_id+"\"></sequenceFlow>"+"\n";
RECUformXMLfile(nodeMap, next_id, next_type);
}
}
}

去哪网实习总结:递归构建“流程运行顺序”的XML文件(JavaWeb)的更多相关文章

  1. 去哪网实习总结:用到的easyui组件总结(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发... 只是还是比較认真的做了三个月,老师非常认同我的工作态度和成果.. . 实习立即就要结束了,总结一下几点之前没有注意过的变成习惯和问题,分享 ...

  2. 去哪网实习总结:JavaWeb中文传參乱码问题的解决(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的.结构却成了系统开发... 只是还是比較认真的做了三个月.老师非常认同我的工作态度和成果... 实习立即就要结束了,总结一下几点之前没有注意过的变成习惯和问题,分享给 ...

  3. 去哪网实习总结:easyui在JavaWeb中的使用,以datagrid为例(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发. . . 只是还是比較认真的做了三个月.老师非常认同我的工作态度和成果.. . 实习立即就要结束了,总结一下几点之前没有注意过的变成习惯和问题, ...

  4. 去哪网实习总结:开发定时任务(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发.. . 只是还是比較认真的做了三个月,老师非常认同我的工作态度和成果.. . 实习立即就要结束了.总结一下几点之前没有注意过的变成习惯和问题,分 ...

  5. 去哪网实习总结:JavaWeb配置404页面(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发. .. 只是还是比較认真的做了三个月,老师非常认同我的工作态度和成果... 实习立即就要结束了,总结一下几点之前没有注意过的变成习惯和问题.分享 ...

  6. 去哪网实习总结:如何配置数据库连接(JavaWeb)

    本来是以做数据挖掘的目的进去哪网的,结构却成了系统开发.. . 只是还是比較认真的做了三个月,老师非常认同我的工作态度和成果. .. 实习立即就要结束了.总结一下几点之前没有注意过的变成习惯和问题,分 ...

  7. maven构建SSM框架中pom.xml文件配置

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  8. 根据构建类型动态设置AndroidManifest.xml文件中的meta-data

    当debug和release版本使用不同的值时,使用Gradle设置相应的值. Android主配置文件 <meta-data android:name="com.amap.api.v ...

  9. Vue.js开发去哪儿网WebApp

    一.项目介绍 这个项目主要参考了去哪儿网的布局,完成了首页.城市选择页面.详情页面的开发. 首页:实现了多区域轮播的功能,以及多区域列表的展示: 城市选择页面:在这个页面实现了城市展示.城市搜索.城市 ...

随机推荐

  1. linux里install命令和cp命令的区别

    转:http://blog.yikuyiku.com/?p=2659 基本上,在Makefile里会用到install,其他地方会用cp命令. 它们完成同样的任务——拷贝文件,它们之间的区别主要如下: ...

  2. 扩展名为的proto的文件

    扩展名为的proto的文件 1. 编写proto文件  首先需要一个proto文件,其中定义了我们程序中需要处理的结构化数据: // Filename: addressbook.proto synta ...

  3. CSRF攻击演示

    CSRF就是伪装成用户做坏事! 它的手段可能是: 一张引发邪恶请求的图片: <img src="http://localhost/demoA.php?money=500" / ...

  4. 搭建java开发环境:安装JDK

    一:下载安装JDK,java7相对稳定成熟 (下载地址>>) 必须选择同意,然后根据自己的系统版本选择对应的jdk 如: 装完jdk就会提示安装jre,一般放同一目录下 配置系统变量: w ...

  5. [Android UI] listview 自定义style

    <style name="comm_listview_style"> <item name="android:cacheColorHint"& ...

  6. 5)Linux程序设计入门--信号处理

    )Linux程序设计入门--信号处理 Linux下的信号事件 前言:这一章我们讨论一下Linux下的信号处理函数. Linux下的信号处理函数: 信号的产生 信号的处理 其它信号函数 一个实例 .信号 ...

  7. Spring持久化

    1. Spring的DAO理念 Spring提供了一套抽象的DAO类,供开发者扩展,这有利于以统一的方式操作各种DAO技术,如JDO.JDBC等,这些抽象DAO类提供了设置数据源及相关辅助信息的方法, ...

  8. 在Qt示例项目的C ++ / QML源中的//! [0]的含义是什么?

    在Qt示例项目的C ++ / QML源中的//! [0]的含义是什么? 例如:  //! [0] GLWidget :: GLWidget(Helper * helper,QWidget * pare ...

  9. PlSQL Oracle 中的 对应 SQL server 中的 IsNull(Expr1,Expr2)

    NVL(Expr1,Expr2)如果Expr1为NULL,返回Expr2的值,否则返回Expr1的值NVL2(Expr1,Expr2,Expr3)如果Expr1为NULL,返回Expr2的值,否则返回 ...

  10. Jquery chosen动态设置值 select Ajax动态载入数据 设置chosen和获取他们选中的值

      在做一个编辑对话框时,要对里面带有select option的操作.主要是想动态载入option和对option的选中.可是由于项目中使用了jquery里的chosen()方法.怎么也无法实现效果 ...