Index: modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java =================================================================== --- modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java (revision 6446) +++ modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java (working copy) @@ -24,6 +24,7 @@ import org.w3c.dom.Element; import org.jbpm.jpdl.internal.xml.JpdlParser; +import org.jbpm.pvm.internal.env.EnvironmentImpl; import org.jbpm.pvm.internal.model.ActivityImpl; import org.jbpm.pvm.internal.util.TagBinding; import org.jbpm.pvm.internal.util.XmlUtil; @@ -32,9 +33,10 @@ /** * @author Tom Baeyens + * @author Huisheng Xu */ public abstract class JpdlBinding extends TagBinding { - + public JpdlBinding(String tagName) { super(tagName, null, null); } @@ -47,12 +49,20 @@ public void parseName(Element element, ActivityImpl activity, Parse parse) { String name = XmlUtil.attribute(element, "name", isNameRequired() ? parse : null); - - if (name!=null) { + + if (name != null) { // basic name validation if ("".equals(name)) { parse.addProblem(XmlUtil.errorMessageAttribute(element, "name", name, "is empty"), element); - } else if (name.indexOf('/')!=-1) { + } + + Boolean isActivityAllowSlash = (Boolean) EnvironmentImpl.getFromCurrent("jbpm.activity.allow.slash", false); + System.out.println(isActivityAllowSlash); + if (isActivityAllowSlash == null) { + isActivityAllowSlash = Boolean.FALSE; + } + System.out.println(isActivityAllowSlash); + if (Boolean.FALSE.equals(isActivityAllowSlash) && name.indexOf('/') != -1) { parse.addProblem(XmlUtil.errorMessageAttribute(element, "name", name, "contains slash (/)"), element); } activity.setName(name); @@ -85,7 +95,7 @@ // transition.setName(transitionName); // // unresolvedTransitions.add(transition, transitionElement); -// +// // jpdlParser.parseOnEvent(transitionElement, parse, transition, Event.TAKE); // } // } Index: modules/test-cfg/src/test/java/org/jbpm/test/slashinactivity/SlashInActivityTest.java =================================================================== --- modules/test-cfg/src/test/java/org/jbpm/test/slashinactivity/SlashInActivityTest.java (revision 0) +++ modules/test-cfg/src/test/java/org/jbpm/test/slashinactivity/SlashInActivityTest.java (revision 0) @@ -0,0 +1,52 @@ +/* + * 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.test.slashinactivity; + +import org.jbpm.api.Configuration; +import org.jbpm.api.Execution; +import org.jbpm.api.ExecutionService; +import org.jbpm.api.JbpmException; +import org.jbpm.api.ProcessEngine; +import org.jbpm.api.ProcessInstance; +import org.jbpm.test.JbpmCustomCfgTestCase; +import org.jbpm.test.JbpmTestCase; + + +public class SlashInActivityTest extends JbpmCustomCfgTestCase { + + private static final String PROCESS_KEY = "test_process"; + + private static final String TEST_PROCESS = + "" + + " " + + " " + + " " + + " " + + ""; + + public void testSlashInActivity() { + deployJpdlXmlString(TEST_PROCESS); + } +} Index: modules/test-cfg/src/test/resources/org/jbpm/test/slashinactivity/jbpm.cfg.xml =================================================================== --- modules/test-cfg/src/test/resources/org/jbpm/test/slashinactivity/jbpm.cfg.xml (revision 0) +++ modules/test-cfg/src/test/resources/org/jbpm/test/slashinactivity/jbpm.cfg.xml (revision 0) @@ -0,0 +1,13 @@ + + + + + + + + + + + + +