[JBoss jBPM] - Schema 3.2 does not have expression as an element and encond
by ggamietea
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
15 years, 4 months
[JBoss jBPM] - Re: Dynamic Fork + External Async WS invocation + problem
by clandestino_bgd
| what you might try is to to create all the tasks first, and then call node.leave on each of them. Might give you some headstart and be able to have them in the DB before the ws calls return...
|
Thanks Ronald.
I thought about something similar, like I create, but not start tasks in Dynamic Fork, and put Action Handler which invokes WS on task-start event.
Then in Dynamic Fork, when I create all child tokens, I iterate again through all of child tokens, find unfinished task instances and then start them all.
That will save me some time, but it does not mean I will manage to win in the race with our superfast WS, since Action Handler which invokes WS calls some business logic, etc.
And to be honest, it does not look very nice. I would also pretty much destroy the applicability of my Dynamic Fork node to other types of processes, which do not have this scenario.
If somebody has better and cleaner idea or have problem solved in the past, I would be happy to hear it.
thanks,
milan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206413#4206413
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206413
15 years, 4 months