[jboss-dev-forums] [Design of JBoss jBPM] - Re: execution transitions, data flow and other associations

brittm do-not-reply at jboss.com
Thu Nov 2 11:12:33 EST 2006


Actually, for Multi-parented processes (Shared Subprocess) I was thinking of something a little more integral.  So many of the features that are needed are already being handled by the standard jBPM subprocess mechanism, such as variable passing, it would be a shame to not handle Shared Subprocesses the same way.

I built my solution with two action handlers, two peristable classes, and an access class:
ShareProcInstAH (on node-enter of the 'shared process node')
SharedProcess (hibernatable shared proc, contains: processInstance, groupLabel, startedByToken, sharedProcParentSet)
SharedProcessParent (hibernatable parent, contains: sharedProc, token, joinedDate)
SharedProcessSession (utility methods)
ShareProcNotifyParentsAH (on end state node-enter of the shared proc)

ShareProcInstAH configuration looks like this:

<state name='SHARED_PROC' >
  |         <event type='node-enter' >
  | 			<!-- If this process is cancelled, or for some other reason must go on without
  | 				the shared sub-process, it is this process's responsibility to break the
  | 				relationship with the sub-process so that this process is not incorrectly 
  | 				signalled if and when the sub-process ends. -->
  |             <action class='com.talk.wf.pd.common.ah.ShareProcInstAH' config-type='bean'>
  | 				<!-- The process instance type that this process will use as a shared
  | 					sub-process. If an available shared sub-process instance already exists, this
  | 					parent will register itself with that; otherwise, a new shared sub-process
  | 					instance will be created. A shared process is avaialable if the shared process  
  | 					is of the specified type and the shared process has a 'sharedProcessGroup' 
  | 					variable who's value is equal to the value of this process's variable that is 
  | 					specified here under <shareGroupVar> -->
  | 				<sharedProcDefName>Shared Proc</sharedProcDefName>
  | 				<!-- The process instance variable that will be compared to the shared process's
  | 					'sharedProcessGroup' variable.  If a new shared process is being created,
  | 					this is the variable who's value will be stored in the shared process's
  | 					'sharedProcessGroup' variable.  This defines the group of parents that will be 
  | 					sharing the single shared process. -->
  | 				<shareGroupVar>orderNum</shareGroupVar>
  | 				<!-- If a new shared process is created, which (if any) of the new shared process's
  | 					parents can	cancel the shared process.  Valid values are 'initiating' and 
  | 					'last remaining'. Default is that no parent can cancel the shared process -->
  | 				<parentCanCancel></parentCanCancel>
  | 				<!-- This parent will only create an association with an existing shared sub-process 
  | 					if that shared process instance has not entered or exited the specified Node.  
  | 					Whether the limitation is entered or exited is determined by the 
  | 					<joinBeforeNodeEvent> setting. The default value is the name of the shared 
  | 					process instance's start-state -->
  | 				<joinBeforeNode></joinBeforeNode>
  | 				<!-- Valid values are 'enter' and 'exit'.  Default value is 'exit'. -->
  | 				<joinBeforeNodeEvent></joinBeforeNodeEvent> 
  | 				<passInVars>someVar as sharedProcVar, someVar2 as sharedProcVar2</passInVars>
  | 				<passOutVars>sharedProcVar as someVar, sharedProcVar2 as someVar2</passOutVars>
  | 			</action>
  | 		</event>
  | 		<transition name='done' to='END'/>
  | 		<transition name='_sys_redoNode' to='SHARED_PROC'/>
  | 	</state>

I'd love to see something like the above configuration incorporated into the process-state.  The only data I'm persisting that wouldn't fit nicely into existing jBPM entities would be the sharedProcParentSet; that would properly need to be a new table associated with ProcessInstance.

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

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



More information about the jboss-dev-forums mailing list