[jboss-user] [JBoss jBPM] - Re: Round trip process to task variable mapping

msandoz do-not-reply at jboss.com
Fri Jun 1 10:56:22 EDT 2007


looking at old posts this topic has been addressed under dataflow and "Add support for specifying process context variable values in the process definition xml"

this is what ive come up with for my situation and id like to know if the solution is reasonable or if there are capabilities of jbpm that im not using through ignorance.

anyway heres what ive done so far:

an xsd for validating data maps

  | <?xml version="1.0" encoding="UTF-8"?>
  | <xsd:schema targetNamespace="http://www.nexusbpm.org/JbpmDataFlowSchema" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:df="http://www.nexusbpm.org/JbpmDataFlowSchema">
  |     <xsd:complexType name="mappingsType">
  |     	<xsd:sequence minOccurs="0" maxOccurs="unbounded">
  |     		<xsd:element name="mapping" type="df:mappingType"></xsd:element>
  |     	</xsd:sequence>
  |     </xsd:complexType>
  | 
  |     <xsd:complexType name="mappingType">
  | 
  |       <xsd:sequence minOccurs="0" maxOccurs="1">
  |         <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
  |       </xsd:sequence> 
  |         <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
  |     	<xsd:attribute name="source" type="xsd:string" use="optional"></xsd:attribute>
  |     	<xsd:attribute name="destination" type="xsd:string"
  |     		use="optional">
  |     	</xsd:attribute>
  |     </xsd:complexType>
  | 
  |     <xsd:element name="mappings" type="df:mappingsType">
  | 		<xsd:unique name="oneMapPerName">
  | 			<xsd:selector xpath="df:mapping"/>
  | 			<xsd:field xpath="@name"/>
  | 		 </xsd:unique>
  |     </xsd:element>
  | 
  | </xsd:schema>

an example of a data map that would be embedded in a node variable:


  | <df:mappings xmlns:df="http://www.nexusbpm.org/JbpmDataFlowSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nexusbpm.org/JbpmDataFlowSchema JbpmDataFlowSchema.xsd " >
  |   <df:mapping name="localvar1" source="processvarname" />
  |   <df:mapping name="localvar2">embedded data</df:mapping>
  |   <df:mapping name="outvar1" destination="destvar"/>
  | </df:mappings>
  | 

for the jpdl i would use something like in the JIRA ticket:


  | <process-state name="p">
  |       <event type="node-enter">
  |          <script>
  |             <variable name="myvariable" access="write" />
  |             <expression>myvariable = "myvalue"</expression>
  |          </script>
  |       </event>
  | 

or another alternative that seems to work for a process variable:


  | 		<script>
  | 		executionContext.setVariable("jythonCode", "print 'foo';");
  | 		</script>
  |    </event>
  | 

an in-place example of mapping would be:

   <node name="jython2">
  |       <action class="com.nexusbpm.services.jython.JythonService">
  |       	<mappings>
  |       		<mapping name="jythonCode">print 'foo';</mapping>
  |       		<mapping name="output" destination="output"/>
  |       		<mapping name="error" destination="error"/>
  |       	</mappings>
  |       </action>
  |       <transition name="toEnd" to="end"></transition>
  |    </node>
  | 

and then a base class for all my node types that will take the initialized mappings and turn them into local variables for use by the subclasses.

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

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



More information about the jboss-user mailing list