?? workflow_stepmain.java
字號:
db_conn.stmt.executeUpdate
("update flow_manager set flow_status = 0 where graph_id = '" +
graphid +
"' ");
status = true;
}
catch (Exception e) {
System.out.println(e);
}
return status;
}
public void restart_flow(String graphid) {}
/////////////////////////////////////////////////////////////////////////////////
//將該點活動狀態設置為0
public void reset_active_step(String step_id, String graph_id) {
try {
db_conn.stmt.executeUpdate
("update step_main set is_active = 0 where graph_id = '" + graph_id +
"' and step_id = '" + step_id + "' ");
}
catch (Exception e) {
System.out.println(e);
}
}
//將該點狀態設置為活動1
public void set_active_step(String step_id, String graph_id) {
try {
db_conn.stmt.executeUpdate
("update step_main set is_active = 1 where graph_id = '" + graph_id +
"' and step_id = '" + step_id + "' ");
}
catch (Exception e) {
System.out.println(e);
}
}
/////////////////////////////////////////////////////////////////////////////////
public boolean active_step(String step_id, String graph_id) { //返回該點狀態值
boolean active_step = false;
int active_re = 0;
try {
db_conn.rs = db_conn.stmt.executeQuery
(
"select count(*) from step_main where is_active = 1 and graph_id = '" +
graph_id + "' and step_id = '" + step_id + "' ");
if (db_conn.rs.next()) {
active_re = db_conn.rs.getInt(1);
}
if (active_re == 1) {
active_step = true;
}
}
catch (Exception e) {
}
return active_step;
}
public String return_FristStep(String graph_id) { //返回該圖第一個節點
String step_id = "";
try {
db_conn.rs2 = db_conn.stmt2.executeQuery
(
"select step_id from step_main where step_name = '工作開始' and graph_id = '" +
graph_id + "' ");
if (db_conn.rs2.next()) {
step_id = db_conn.rs2.getString("step_id");
}
db_conn.stmt2.close();
db_conn.rs2.close();
}
catch (Exception e) {
System.out.println("返回第一個節點錯");
}
return step_id;
}
public String return_FirstStepName(String graph_id) { //返回第一個點的名稱
String step_name = "";
return step_name;
}
public String return_LastStep(String graph_id) { //返回該圖最后一個節點
String step_id = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
(
"select step_id from step_main where step_name = '工作結束' and graph_id = '" +
graph_id + "'");
if (db_conn.rs.next()) {
step_id = db_conn.rs.getString("step_id");
// db_conn.stmt.close();
// db_conn.rs.close();
}
}
catch (Exception e) {
System.out.println(e);
}
return step_id;
}
public String return_nextStep(String step_id, String graph_id) { //返回該點的下一個節點ID
String Step_id_next = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select to_step from edge_control where from_step = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
if (db_conn.rs.next()) {
Step_id_next = db_conn.rs.getString("to_step");
// System.out.println(Step_id_next);
// db_conn.stmt.close();
// db_conn.rs.close();
}
}
catch (Exception e) {
System.out.println("next");
}
return Step_id_next;
}
public String return_preStep(String step_id, String graph_id) { //返回該點的上一個節點ID
String Step_id_pre = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select from_step from edge_control where to_step = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
if (db_conn.rs.next()) {
Step_id_pre = db_conn.rs.getString("step_id");
db_conn.stmt.close();
db_conn.rs.close();
}
}
catch (Exception e) {
System.out.println("返回上一個節點錯");
}
return Step_id_pre;
}
public java.util.ArrayList return_nextSteps(String graph_id, String step_id) {
//返回該點的下N個節點ID
java.util.ArrayList al = new java.util.ArrayList();
try {
db_conn.rs = db_conn.stmt.executeQuery
("select to_step from edge_control where from_step = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
while (db_conn.rs.next()) {
al.add( (String) db_conn.rs.getString("to_step"));
}
}
catch (Exception e) {
System.out.println(e);
}
return al;
}
public java.util.ArrayList return_preSteps(String graph_id, String step_id) {
//返回該點的上N個節點ID
java.util.ArrayList all = new java.util.ArrayList();
int i = 0;
try {
db_conn.rs = db_conn.stmt.executeQuery
("select from_step from edge_control where to_step = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
while (db_conn.rs.next()) {
all.add( (String) db_conn.rs.getString("from_step"));
}
// db_conn.stmt.close();
// db_conn.rs.close();
}
catch (Exception e) {
System.out.println("返回上N個節點錯");
}
return all;
}
public String Result_Return_NextStep(String Step_id, String graph_id,
int status) { //根據條件返回該點的下一個節點ID
String Step_id_nextbystatus = "";
return Step_id_nextbystatus;
}
// 根據STEPID獲得STEP的名稱
public String get_stepname(String stepid, String graphid) {
String name = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select step_name from step_main where graph_id = '" + graphid +
"' and step_id = '" + stepid + "' ");
if (db_conn.rs.next()) {
name = db_conn.rs.getString("step_name");
}
}
catch (Exception e) {
System.out.println(e);
}
return name;
}
public String get_stepid(String stepname, String graphid) {
String name = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select step_id from step_main where graph_id = '" + graphid +
"' and step_name = '" + stepname + "' ");
if (db_conn.rs.next()) {
name = db_conn.rs.getString("step_id");
}
db_conn.rs.close();
// db_conn.stmt.close();
}
catch (Exception e) {
System.out.println(e);
}
return name;
}
public String is_step_active(String graph_id) {
//獲得該點其他狀態............
// boolean status = false;
String id = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select step_id from step_main where graph_id = '" + graph_id +
"' and is_active = 1 ");
if (db_conn.rs.next()) {
id = db_conn.rs.getString("step_id");
}
// db_conn.stmt.close();
// db_conn.rs.close();
}
catch (Exception e) {
System.out.println(e);
}
return id;
}
public void Set_Active(String Step_id, String graph_id) { //將該點設置為活動
}
public void Set_Actioned(String Step_id, String graph_id) { //將該點設置為已經處理
}
public void Reset_visited(String graph_id) { //將該圖訪問狀態恢復為初始狀態
try {
db_conn.stmt.executeUpdate
("update step_main set visited =0 where graph_id = '" + graph_id +
"' ");
}
catch (Exception e) {
System.out.println(e);
}
}
public void Reset_lastStep(int Step, String graph_id) { //將該點狀態恢復到上一次的狀態
}
public void set_visited_time(String step_id, String graph_id, int j) { //將該點訪問狀態設置為1
try {
db_conn.stmt.executeUpdate
("update step_main set visited ='" + j + "' where step_id = '" +
step_id +
"' and graph_id = '" + graph_id + "' ");
}
catch (Exception e) {
System.out.println(e);
}
}
public void set_visited(String step_id, String graph_id) { //將該點訪問狀態設置為1
try {
db_conn.stmt.executeUpdate
("update step_main set visited = '1' where step_id = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
}
catch (Exception e) {
System.out.println(e);
}
}
public void Reset_visited(String Step, String graph_id) { //將該點訪問狀態設置為0
}
public boolean get_visited(String step_id, String graph_id) { // 返回該點訪問狀態
boolean vi = false;
String vis = "";
try {
db_conn.rs = db_conn.stmt.executeQuery
("select visited from step_main where step_id = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
if (db_conn.rs.next()) {
vis = db_conn.rs.getString("visited");
if (vis.equals("1")) {
vi = true;
// System.out.println("visited");
}
else {
vi = false;
// System.out.println("not visited");
}
// db_conn.stmt.close();
// db_conn.rs.close();
}
}
catch (Exception e) {
System.out.println(e);
}
return vi;
}
public int get_visited_times(String step_id, String graph_id) { // 返回該點被訪問次數
int vi = 0;
try {
db_conn.rs = db_conn.stmt.executeQuery
("select visited from step_main where step_id = '" + step_id +
"' and graph_id = '" + graph_id + "' ");
if (db_conn.rs.next()) {
vi = db_conn.rs.getInt("visited");
}
}
catch (Exception e) {
System.out.println(e);
}
return vi;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -