Package org.fireflow.model.io

Examples of org.fireflow.model.io.Dom4JFPDLParser


        if (workflowProcess == null) {
            if (this.processContent != null && !this.processContent.trim().equals("")) {

                ByteArrayInputStream in = null;
                try {
                    Dom4JFPDLParser parser = new Dom4JFPDLParser();//采用dom4j来解析xml
                    in = new ByteArrayInputStream(this.processContent.getBytes("utf-8"));
                    this.workflowProcess = parser.parse(in);

                } catch (UnsupportedEncodingException ex) {
                    Logger.getLogger(WorkflowDefinition.class.getName()).log(Level.SEVERE, null, ex);
                    throw new RuntimeException(ex.getMessage());
                } catch (IOException ex) {
View Full Code Here


     * @see org.fireflow.engine.definition.IDefinitionService#setDefinitionFiles(java.util.List)
     */
    public void setDefinitionFiles(List<String> workflowProcessFileNames)
            throws IOException, FPDLParserException,EngineException {
        if (workflowProcessFileNames != null) {
            Dom4JFPDLParser parser = new Dom4JFPDLParser();
            for (int i = 0; i < workflowProcessFileNames.size(); i++) {
                InputStream inStream = this.getClass().getResourceAsStream(
                        workflowProcessFileNames.get(i).trim());
                if (inStream == null) {
                    throw new IOException("没有找到名称为" + workflowProcessFileNames.get(i) + "的流程定义文件");
                }
               
                WorkflowProcess workflowProcess = parser.parse(inStream);

                WorkflowDefinition workflowDef = new WorkflowDefinition();
                workflowDef.setVersion(new Integer(1));

                workflowDef.setWorkflowProcess(workflowProcess);
View Full Code Here

        List<String> workflowProcessIds = (List<String>) transactionTemplate.execute(new TransactionCallback() {

            public Object doInTransaction(TransactionStatus arg0) {
                List<String> ids = new ArrayList<String>();
                if (workflowProcessFileNames != null) {
                    Dom4JFPDLParser parser = new Dom4JFPDLParser();
                    for (int i = 0; i < workflowProcessFileNames.size(); i++) {
                        try {
                            InputStream inStream = this.getClass().getResourceAsStream(workflowProcessFileNames.get(i).trim());
                            WorkflowProcess workflowProcess = parser.parse(inStream);
                            WorkflowDefinition workflowDef = new WorkflowDefinition();
                            workflowDef.setWorkflowProcess(workflowProcess);
                            ids.add(workflowProcess.getId());
                            persistenceService.saveOrUpdateWorkflowDefinition(workflowDef);
                        } catch (IOException ex) {
View Full Code Here

TOP

Related Classes of org.fireflow.model.io.Dom4JFPDLParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.