02-28-2011 02:07 AM
[27/02/11 12:47:23] Josh Long: ive officially got 70% of what i wanted to support in the component code for the Spring module working. i wondered if i might talk to you about the last 30% 🙂
[27/02/11 12:54:39] Josh Long: at the moment, there is support for:
1) Activiti POJOs:
class CustomerService {
@StartProcess('customer-fulfillment')
public void enrollCustomer(@ProcessVariable('customerId') long customerId) { … }
}
..
@Autowired private CustomerService cs ;
// …
cs.enrollCustomer( 232) ; // automatically launches a ProcessInstance
2) scoped beans
@Scoped('process") Foo foo ; //the bean is created and destroyed on process instance lifecycle demarcations
Inside of Foo, i imght have the following declaration:
// injects the current process instance 'customerId'
@Value( "#{ processVariables['customerId'] }")
private long customerId;
I can also do:
@Autowired private ProcessInstance processInstance ;
in any bean - scoped or not. its injects a proxy so that, even if the containg bean is not scoped, the methods called on the ProcessInstance are to the currently active, scoped ProcessInstance and so it is threadsafe.
[27/02/11 12:59:41] Josh Long: let me know when youre free - i want to talk about the possibility of having serviceTasks that delegate to a single registered instance so that i could simply write:
<serviceTask id="notifyCustomer" />
and, since no bean is explicitly configured, a default bean gets invoked and that bean, in my case, is a Spring handler that would look at the fact that the
<serviceTask> is named 'notifyCustomer' and would look for a POJO that has
@ActivitiMapping(serviceTask ='notifyCustomer')
public void myCustomServiceTaskHandlerMethod ( @ProcessVariable('customerId') long customerId) {
// ..
}
and would automatically call it
02-28-2011 04:18 AM
02-28-2011 09:47 PM
<serviceTask id = "enroll-customer" />
I want to setup the ProcessEngine to then attempt to look up the correct handler (like a 'default' handler JavaDelegate o ReceiveTaskActivity ). @ActivitiMapping( serviceTask = 'enroll-customer')
public void handleEnrollCustomerTask() { }
@ActivitiMapping( serviceTask = 'enroll-customer')
public void handleEnrollCustomerTask( @ProcessVariable( "customerId") Long customerId ) { }
@ActivitiMapping( serviceTask = 'enroll-customer')
public void handleEnrollCustomerTask( @ProcessInstance ProcessInstance pi,
@ProcessVariable( "customerId") Long customerId ) { }
<serviceTask id="enroll-customer" name="enroll-customer"
activiti:delegateExpression="#{registry}"/>
etc. 03-08-2011 03:03 AM
@ActivitiMapping( serviceTask = 'enroll-customer')
public void handleEnrollCustomerTask( @ProcessInstance ProcessInstance pi,
@ProcessVariable( "customerId") Long customerId ) { }
<serviceTask id="enroll-customer" activiti:type="spring-annotation-mapping">
03-08-2011 05:48 AM
<serviceTask id="enroll-customer" activiti:type="spring-annotation-mapping">
<serviceTask id="enroll-customer" name="enroll-customer" activiti:delegateExpression="#{…}"/>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.