一个用数据库实现的工作流(6)

2008-02-23 09:55:08来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


wf.setEndDate(rs.getTimestamp("end_date"));
wf.setFlowId(rs.getString("flow_id"));
return wf;

}
});
if (list != null && list.size() > 0) {
return (Workflow[]) list.toArray(new Workflow[list.size()]);
}
return null;
}

public void setSequenceService(SequenceService sequenceService) {
this.sequenceService = sequenceService;
}

public void terminateWorkFlow(Workflow workFlow) {
}

public void updateTemplate(String id, WorkflowTemplate template) {
this.getJdbcTemplate().update(
"update workflow_template set name=?,description=?,status=? where id=?",
new Object[] {
template.getName(), template.getDescription(),
new Integer(template.getStatus()), id
},
new int[] {
Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.VARCHAR});
}

public void updateTemplateNode(String id, WorkflowTemplateNode flowNode) {
this.getJdbcTemplate().update(
"update workflow_template_flow set name=?,description=?,sequence=? Where id=?",
new Object[] {
flowNode.getName(), flowNode.getDescription(),
new Integer(flowNode.getSequence()), id
},
new int[] {
Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.VARCHAR});
}

/**
* 更新工作流
* @param id String
* @param workflow Workflow
*/
public void updateWorkflow(String id, Workflow workflow) {
this.getJdbcTemplate().update(
"update workflow_work set doc_id=?,status=?,"
"flow_id=?,start_date=?,end_date=?,comment=? from workflow_work where id=?",
new Object[] {workflow.getDocId(),
new Integer(workflow.getStatus()),
workflow.getFlowId(), workflow.getStartDate(),
workflow.getEndDate(), workflow.getComment(),
id}, new int[] {Types.VARCHAR, Types.INTEGER,
Types.VARCHAR, Types.TIMESTAMP,
Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR});
}

public void addNewTemplateNodeMan(String template_node_id,
String account_id) {
String id = this.sequenceService.getValue(this.
WORKFLOW_TEMPLATE_NODE_MAN_SEQ);
this.getJdbcTemplate().update("insert into workflow_template_man(id,template_flow_id,account_id) values(?,?,?)",
new Object[] {id, template_node_id,
account_id}, new int[] {Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR});
}

public void deleteTemplateNodeMan(String template_node_id,
String account_id) {
this.getJdbcTemplate().update(
"delete from workflow_template_man where template_flow_id=? and account_id=?",
new Object[] {template_node_id,
account_id}, new int[] {Types.VARCHAR, Types.VARCHAR});

}

/**
*
* @param flowNode WorkflowNode
* @return String
*/
public String addNewWorkflowNode(WorkflowNode flowNode) {
String id = this.sequenceService.getValue(this.WORKFLOW_NODE_SEQ);
//
this.getJdbcTemplate().update(
"insert into workflow_flow(id,work_id,status,"
"sequence,name,description,comment,start_date,end_date,audit_man) values(?,?,?,?,?,?,?,?,?,?)",
new Object[] {
id, flowNode.getWorkId(), new Integer(flowNode.getStatus()),
new Integer(flowNode.getSequence()),
flowNode.getName(), flowNode.getDescription(),
flowNode.getComment(),
flowNode.getStartDate(), flowNode.getEndDate(),
flowNode.getAuditMan()},
new int[] {
Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER,
Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR, Types.DATE, Types.DATE,
Types.VARCHAR});

//插入人员信息
if (flowNode.getMans() != null) {
List mans = flowNode.getMans();

for (int i = 0; i < mans.size(); i ) {
String man_id = this.sequenceService.getValue(this.
WORKFLOW_NODE_MAN_SEQ);
String account_id = (String) mans.get(i);

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:[学习小记]Java的反射机制

下一篇:我的J2ME编程联系(1)——List