[jbpm-commits] JBoss JBPM SVN: r6806 - in projects/migration_tool/trunk: src/main/java/org/jbpm/migration and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Nov 9 10:30:39 EST 2010
Author: eschabell
Date: 2010-11-09 10:30:38 -0500 (Tue, 09 Nov 2010)
New Revision: 6806
Removed:
projects/migration_tool/trunk/notes.txt
projects/migration_tool/trunk/src/main/java/org/jbpm/migration/BpmnValidator.java
projects/migration_tool/trunk/src/main/java/org/jbpm/migration/JpdlValidator.java
projects/migration_tool/trunk/src/main/java/org/jbpm/migration/Migrator.java
projects/migration_tool/trunk/src/main/java/org/jbpm/migration/ProcessTransformer.java
projects/migration_tool/trunk/src/main/java/org/jbpm/migration/util/
projects/migration_tool/trunk/src/test/java/org/jbpm/migration/
Modified:
projects/migration_tool/trunk/readme.txt
Log:
Cleaned out sources you find in the new project location, marked the readme with a fwding address!
Deleted: projects/migration_tool/trunk/notes.txt
===================================================================
--- projects/migration_tool/trunk/notes.txt 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/notes.txt 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,18 +0,0 @@
-Some interesting points to take a look at, this file will bookmark them for this projects:
-
-Some conversion tooling that exists for v3 jPDL -> v4 jPDL:
-- http://docs.jboss.org/jbpm/v4/devguide/html_single/#processconversiontool
-
-
-03.03.2010 - waiting a bit on this project to get oriented with reactions to my ideas (migration strategy) that I will be
- presenting to some developer organizations. I want to see how they respond.
-
-21.10.2010 - team together, looking at code generated by previous member. jBPM5 alpha code examined and decided that due to
- lack of maturity to start working on this tooling as follows:
-
- - validate jPDL3 input file against jPDL3 XSD
- - transform jPDL3 to BPMN2 via XSLT
- - validate BPMN2 output file against BPMN2 XSD
- - at this point, up to the engine to run validated BPMN2 process def's!
-
- Updated existing project XSD's with BPMN2 found in the world (now they exist in a finalized form).
\ No newline at end of file
Modified: projects/migration_tool/trunk/readme.txt
===================================================================
--- projects/migration_tool/trunk/readme.txt 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/readme.txt 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,5 +1,10 @@
This is the start sign for the jBPM migration tool that should provide us with a path to migrate from jBPM v3.2.x jPDL -> BPMN2 as
-supported in jBPM v4.x. Stay tuned as this will be expanded with the projects guidelines and goals.
+supported in jBPM v5.x.
-Eric D. Schabell
+Please refer to the project site for more information:
+https://sourceforge.net/apps/trac/jbpmmigration
+
+Regards,
+Maurice de Chateau
+Eric D. Schabell
\ No newline at end of file
Deleted: projects/migration_tool/trunk/src/main/java/org/jbpm/migration/BpmnValidator.java
===================================================================
--- projects/migration_tool/trunk/src/main/java/org/jbpm/migration/BpmnValidator.java 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/src/main/java/org/jbpm/migration/BpmnValidator.java 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.migration;
-
-import java.io.File;
-import java.net.URISyntaxException;
-
-import org.apache.log4j.Logger;
-import org.jbpm.migration.util.XmlUtils;
-import org.w3c.dom.Document;
-
-/**
- * This class validates a resulting jDPL definition against the applicable XML schema.
- *
- * @author Eric D. Schabell
- * @author Maurice de Chateau
- */
-public final class BpmnValidator {
- /* XML Schema file for BPMN version 2.0 on the classpath. */
- private static final String BPMN_2_0_SCHEMA = "Schemas/BPMN/BPMN20.xsd";
-
- /** Logging facility. */
- private static final Logger LOGGER = Logger.getLogger(BpmnValidator.class);
-
- /** Private constructor to enforce non-instantiability. */
- private BpmnValidator() {
- }
-
- /**
- * Validate a given BPMN process definition against the applicable schema.
- *
- * @param bpmn
- * The process definition.
- * @param gpd
- * The graphical positioning for the process definition.
- * @return The concatenated document containing both process definition and positioning, or null if (one of) the validations was
- * not successful.
- */
- public static boolean validateDefinition(Document bpmn) {
- // Validate against the jPDL schema.
- File schema = null;
- try {
- schema = new File(BpmnValidator.class.getClassLoader().getResource(BPMN_2_0_SCHEMA).toURI());
- } catch (URISyntaxException usEx) {
- LOGGER.error("Cannot locate BPMN schema.", usEx);
- return false;
- }
- return XmlUtils.validate(bpmn, schema);
- }
-}
Deleted: projects/migration_tool/trunk/src/main/java/org/jbpm/migration/JpdlValidator.java
===================================================================
--- projects/migration_tool/trunk/src/main/java/org/jbpm/migration/JpdlValidator.java 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/src/main/java/org/jbpm/migration/JpdlValidator.java 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,122 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.migration;
-
-import java.io.File;
-import java.net.URISyntaxException;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-import org.jbpm.migration.util.XmlUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * This class validates an original jDPL definition against the applicable XML schema.
- * <p>
- * TODO: Make jPDL version flexible (now only 3.2 is supported).<br>
- * TODO: Include validation for GPD.
- *
- * @author Eric D. Schabell
- * @author Maurice de Chateau
- */
-public final class JpdlValidator {
- /* XML Schema file for jPDL version 3.2 on the classpath. */
- private static final String JPDL_3_2_SCHEMA = "Schemas/jPDL/jpdl-3.2.xsd";
-
- /** Tag name for the root node (document element) of the concatenated document. */
- private static final String CONCATENATED_ROOT_NODE = "concatenated-root";
-
- /** Logging facility. */
- private static final Logger LOGGER = Logger.getLogger(JpdlValidator.class);
-
- /** Private constructor to enforce non-instantiability. */
- private JpdlValidator() {
- }
-
- /**
- * Parse and validate a given jDPL/GPD process definition against the applicable schema.
- *
- * @param jpdl
- * The process definition.
- * @param gpd
- * The graphical positioning for the process definition.
- * @return The concatenated document containing both process definition and positioning, or null if (one of) the validations was
- * not successful.
- */
- public static Document validateDefinition(File jpdl, File gpd) {
- Document jpdlDoc = validateProcess(jpdl);
- Document gpdDoc = validatePositioning(gpd);
-
- Document concatenated = null;
- if (jpdlDoc != null && gpdDoc != null) {
- try {
- concatenated = XmlUtils.createEmptyDocument();
- Node rootNode = concatenated.createElement(CONCATENATED_ROOT_NODE);
- concatenated.appendChild(rootNode);
- Node jpdlNode = concatenated.importNode(jpdlDoc.getDocumentElement(), true);
- rootNode.appendChild(jpdlNode);
- Node gpdNode = concatenated.importNode(gpdDoc.getDocumentElement(), true);
- rootNode.appendChild(gpdNode);
- } catch (Exception ex) {
- LOGGER.error("Problem concatenating the jDPL and GPD definitions.", ex);
- }
- }
- return concatenated;
- }
-
- private static Document validateProcess(File jpdl) {
- // Parse the jDPL definition into a DOM tree.
- Document document = XmlUtils.parseFile(jpdl);
- if (document == null) {
- return null;
- }
-
- // Get the jPDL version from the process definition.
- Node xmlnsNode = document.getFirstChild().getAttributes().getNamedItem("xmlns");
- if (xmlnsNode != null && StringUtils.isNotBlank(xmlnsNode.getNodeValue())) {
- String version = xmlnsNode.getNodeValue().substring(xmlnsNode.getNodeValue().length() - 3);
- LOGGER.info("jPDL version == " + version);
- }
-
- // Validate against the jPDL schema.
- File schema = null;
- try {
- schema = new File(JpdlValidator.class.getClassLoader().getResource(JPDL_3_2_SCHEMA).toURI());
- } catch (URISyntaxException usEx) {
- LOGGER.error("Cannot locate jPDL schema.", usEx);
- return null;
- }
- return XmlUtils.validate(document, schema) ? document : null;
- }
-
- private static Document validatePositioning(File gpd) {
- // Parse the GPD definition into a DOM tree.
- Document document = XmlUtils.parseFile(gpd);
- if (document == null) {
- return null;
- }
-
- // TODO: Validate the document before returning it.
- return document;
- }
-}
Deleted: projects/migration_tool/trunk/src/main/java/org/jbpm/migration/Migrator.java
===================================================================
--- projects/migration_tool/trunk/src/main/java/org/jbpm/migration/Migrator.java 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/src/main/java/org/jbpm/migration/Migrator.java 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.migration;
-
-import java.io.File;
-
-import org.apache.commons.lang.StringUtils;
-import org.jbpm.migration.util.XmlUtils;
-import org.w3c.dom.Document;
-
-/**
- * This class migrate a jPDL process definition to an equivalent BPMN 2.0 process definition.
- *
- * @author Eric D. Schabell
- * @author Maurice de Chateau
- */
-public class Migrator {
- /**
- * @param args
- * The input for this method:<br>
- * <ul>
- * <li>args[0]: The (full) path of the jPDL process definition that's to be migrated.</li>
- * <li>args[1]: The (full) path of the corresponding GPD positioning file.</li>
- * </ul>
- * Any further arguments are ignored.
- */
- public static void main(String[] args) {
- // Check the input.
- if (args.length != 2 || StringUtils.isBlank(args[0]) || StringUtils.isBlank(args[1])) {
- throw new IllegalArgumentException("Insufficient arguments for the migrator (must be 2).");
- }
- File jpdl = new File(args[0]);
- File gpd = new File(args[1]);
- if (!jpdl.isFile() || !gpd.isFile()) {
- throw new IllegalArgumentException("Both of the input arguments must be files.");
- }
-
- // Validate the jPDL and GPD files.
- Document input = JpdlValidator.validateDefinition(jpdl, gpd);
- System.out.println(XmlUtils.format(input));
-
- // Transform the process.
- Document output = ProcessTransformer.transform(input);
- System.out.println(XmlUtils.format(output));
-
- // TODO: Validate the BPMN file.
- }
-}
Deleted: projects/migration_tool/trunk/src/main/java/org/jbpm/migration/ProcessTransformer.java
===================================================================
--- projects/migration_tool/trunk/src/main/java/org/jbpm/migration/ProcessTransformer.java 2010-11-09 15:23:03 UTC (rev 6805)
+++ projects/migration_tool/trunk/src/main/java/org/jbpm/migration/ProcessTransformer.java 2010-11-09 15:30:38 UTC (rev 6806)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.migration;
-
-import java.io.File;
-import java.net.URISyntaxException;
-
-import org.apache.log4j.Logger;
-import org.jbpm.migration.util.XmlUtils;
-import org.w3c.dom.Document;
-
-/**
- * Transforms a given jPDL/GPD definition to an equivalent BPMN 2.0 definition.
- *
- * @author Eric D. Schabell
- * @author Maurice de Chateau
- */
-public final class ProcessTransformer {
- /* XSL Transformation file for jPDL version 3.2 on the classpath. */
- private static final String MIGRATION_STYLE_SHEET = "jpdl3-bpmn2.xsl";
-
- /** Logging facility. */
- private static final Logger LOGGER = Logger.getLogger(ProcessTransformer.class);
-
- /** Private contractor to prevent instantiation. */
- private ProcessTransformer() {
- }
-
- public static Document transform(Document jpdl) {
- File styleSheet = null;
- try {
- styleSheet = new File(JpdlValidator.class.getClassLoader().getResource(MIGRATION_STYLE_SHEET).toURI());
- } catch (URISyntaxException usEx) {
- LOGGER.error("Cannot locate jPDL to BPMN style sheet.", usEx);
- return null;
- }
- return XmlUtils.transform(jpdl, styleSheet);
- }
-}
More information about the jbpm-commits
mailing list