[jboss-user] [JBoss jBPM] - Schema 3.2 does not have expression as an element and encond

ggamietea do-not-reply at jboss.com
Tue Feb 3 12:54:39 EST 2009


Hi all,

I'm working with jaxb to create a process definition. I've generated all jpdl beans but I've found my self into trouble when I wanted to add an expression  tag in side script tag.

This is the processdefinition.xml that I need

  | <?xml version="1.0" encoding="UTF-8"?>
  | <process-definition  name="validation_case_2" xmlns="urn:jbpm.org:jpdl-3.2">
  |     <description>
  |         Definition to test case 2 where we will have one form
  |     </description>
  |     <event type="process-start"  >
  |         <script >
  |             <expression>
  |                 <![CDATA[
  |                 processDataList = new com.package.MyClass1();
  | 
  |                 //ProcessData1
  |                 processData1 = new com.package.MyClass2();
  |             </expression>
  |             <variable name="taskDataList" mapped-name="processDataList"/>
  |         </script>
  |     </event>
  |     <start-state name="process-start" >
  |         <transition to="task-1" ></transition>
  |     </start-state>
  |     .
  |     .
  | 

This is the code and output that I've in order to create the process definition

  | ProcessDefinition pd = new ProcessDefinition();
  | 
  | pd.setName("gaston");
  | pd.getDescriptionOrSwimlaneOrStartState().add("asi la descripcion del proceso");
  | 
  | Event startEvent = new Event();
  | startEvent.setType("process-start");
  | 
  | Script startScript = new Script();
  | StringBuffer sb = new StringBuffer();
  | sb.append("\n\t\t");
  | sb.append("<expression>");
  | sb.append("\n\t\t\t");
  | sb.append("<![CDATA[");
  | sb.append("\n\t\t\t");
  | sb.append("processDataList = new com.package.MyClass1();");
  | sb.append("\n\t\t\t");
  | sb.append("processData1 = new com.package.MyClass2();");
  | sb.append("\n\t\t\t");
  | sb.append("]]>");
  | sb.append("\n\t\t");
  | sb.append("</expression>");
  | sb.append("\n\t");
  | 
  | String s = new String(sb);
  | 
  | startScript.getContent().add(s);
  | 
  | startEvent.getActionOrScriptOrCreateTimer().add(startScript);
  | 
  | pd.getDescriptionOrSwimlaneOrStartState().add(startEvent);
  | 
Output

  | <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  | <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="gaston">
  |     <description>asi la descripcion del proceso</description>
  |     <event type="process-start">
  |         <script>
  | 		<expression>
  | 			<![CDATA[
  | 			processDataList = new com.package.MyClass1();
  | 			processData1 = new com.package.MyClass2();
  | 			]]>
  | 		</expression>
  | 	</script>
  |     </event>
  | </process-definition>
  | 
First problem...

It seems that script class does not have an expression tag which I could use so I've add it as string to its content... is this approach correct ?

Second problem...

As you can see I'm facing encoding problems with start and end tag symbol. I've tried with other encodings but none of them worked. Does anyone know how to solve this ? Is the CDATA tag the problem ?

My main concern now is to solve the encoding issue.

Thanks in advance !!!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206682#4206682

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206682



More information about the jboss-user mailing list