Author: Grid.Qian
Date: 2008-10-15 04:10:33 -0400 (Wed, 15 Oct 2008)
New Revision: 10845
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
Log:
JBIDE-2896:fix subprocess's name is null
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-15
07:09:35 UTC (rev 10844)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-15
08:10:33 UTC (rev 10845)
@@ -283,8 +283,8 @@
}
/*
- * Translate a bpmn subprocess to a jpdl processstate and a new jpdl process
- * difinition
+ * Translate a bpmn subprocess to a jpdl process-state and a new jpdl process
+ * definition
*/
private void translateSubprocess(Element subProcess, Element element) {
Element processRoot = translateGraph(subProcess);
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-15
07:09:35 UTC (rev 10844)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-15
08:10:33 UTC (rev 10845)
@@ -90,14 +90,31 @@
} else {
String str = generateProcessName(graph.getParent());
if (str == null) {
- return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ return generateElementName(graph);
} else {
return str + B2JMessages.Folder_Name_Separator
- + graph.attributeValue(B2JMessages.Dom_Element_Name);
+ + generateElementName(graph);
}
}
}
+
+ /*
+ * generate a element name
+ */
+ public static String generateElementName(Element graph){
+ String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+ if (name == null || "".equals(name)) {
+ name = "au_gen";
+ }
+ Integer i = nameMap.get(name);
+ if (i == null) {
+ nameMap.put(name, new Integer("1"));
+ } else {
+ nameMap.put(name, ++i);
+ }
+ return name;
+ }
/*
* check the bpmn element name is null or "" or same to another element name
@@ -109,7 +126,7 @@
String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
if (name == null || "".equals(name)) {
- name = "jboss_autogen";
+ name = "au_gen";
isOk = false;
}
Integer i = nameMap.get(name);
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-15
07:09:35 UTC (rev 10844)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-15
08:10:33 UTC (rev 10845)
@@ -129,7 +129,7 @@
public IWizardPage getNextPage(IWizardPage page) {
if (page.getName()
- .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ .equals(B2JMessages.Bpmn_Translate_Message_WizardPage_Name)) {
errorList = translateBpmnToStrings();
if (errorList.size() == 0) {
return locationPage;
Show replies by date