ssh2+jbpm4.4 Project Approval Flow: The thinking of approval process management

Source: Internet
Author: User

1. Create a Processdefinitionaction.java

Package Cn.itcast.oa.view.action;import Java.io.file;import Java.io.fileinputstream;import java.io.InputStream; Import Java.util.list;import Java.util.zip.zipinputstream;import Org.jbpm.api.processdefinition;import Org.springframework.context.annotation.scope;import Org.springframework.stereotype.controller;import Cn.itcast.oa.service.processdefinitionservice;import Com.opensymphony.xwork2.ActionContext; @Controller @scope ("    Prototype ") public class Processdefinitionaction extends Baseaction{private String key; Private File upload;  Upload private String id;private inputstream InputStream; Download the/** list */public String list () throws Exception {list<processdefinition> processdefinitionlist= Processdefinitionservice.findalllatestversions (); Actioncontext.getcontext (). Put ("Processdefinitionlist", processdefinitionlist); return "List";} /** deployment Process Definition page */public String addui () throws Exception {return "Addui";} /** deployment Process Definition */public String Add () throws Exception {Zipinputstream zipinputstream=new zipinPutstream (new FileInputStream (upload));p Rocessdefinitionservice.deploy (zipinputstream); return "ToList";} /** Delete process definition */public String Delete () throws Exception {Processdefinitionservice.deletebykey (key); return "ToList";} /** list */public String downloadprocessinmage () throws Exception {inputstream= Processdefinitionservice.getprocessimageresourceasstream (ID); return "Downloadprocessinmage";} ----------------------public InputStream getInputStream () {return inputstream;} public void Setinputstream (InputStream inputstream) {this.inputstream = InputStream;} Public String GetKey () {return key;} Public File Getupload () {return upload;} public void Setupload (File upload) {this.upload = upload;} public void Setkey (String key) {This.key = key;} Public String GetId () {return ID;} public void SetId (String id) {this.id = id;}}
2. How to implement the corresponding service layer
3. Configuring the Strutsxml File

<!--approval Flow: Approval process management--><action name= "processdefinitionaction_*" class= "processdefinitionaction" method= "{1}" ><result name= "list" >/web-inf/jsp/processdefinitionaction/list.jsp</result><result name= "AddUI ">/web-inf/jsp/processdefinitionaction/addui.jsp</result><result name=" toList "type=" RedirectAction " >processDefinitionAction_list</result><!--Download Dedicated results configuration--><result name= "Downloadprocessimage" type = "Stream" > <param name= "contentType" >image/png</param> <param name= "InputName" >inputstream </param></result></action>

4. Add the appropriate page to


ssh2+jbpm4.4 Project Approval Flow: The thinking of approval process management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.