05-23-2011 09:16 PM
Map<String,Object> variableMap = new HashMap<String,Object>();
… populate variableMap with inputs from the client-tier …
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myprocess",variableMap);
// Check the after variables to see if any errors occurred, etc.
Map<String, Object> afterVariables = runtimeService.getVariables(pi.getId());
… check the after variables for error messages that have stacked up, send the error messages back to the user …
// Finish the process by triggering the "finishProcessReceiveTask"
Execution finishProcessTaskExecution = runtimeService.createExecutionQuery().processInstanceId(
processInstance.getId()).activityId("finishProcessReceiveTask").singleResult();
runtimeService.signal(finishProcessTaskExecution.getId());
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
…
<property name="history" value="audit" />
…
</bean>
05-24-2011 03:23 AM
My question is: How are other people handling "out" variables like these? Am I missing something critical that I'm not thinking about?
05-24-2011 09:51 PM
What goes into the engine is just needed for the flow and the process updates domain data where needed
05-24-2011 10:19 PM
So are ours…What goes into the engine is just needed for the flow and the process updates domain data where needed
I see, thanks. I should mention that we have similar processes … domain objects get updated for the primary purpose of being updated in the database … however the tricky part is that our processes are typically invoked in the context of a request/response type of flow.
For example:Ahhh.. .but that will never be the megabyts of data then like you mentioned will it? If so I still miss something…User submits request (async @ the client)
Middle-tier receives the request, starts a process flow.
Activiti process either succeeds or fails based upon many rules, database calls, etc.
Upon failure (of which there may be many listed) we want to show the user the list of errors as the response to the request.
I suppose the list of errors could be written to a database to be retrieved via a separate DAO call after the process executes, but it just seems like overkill for our scenario, especially given that we already have the variables set in the process domain, we just need to get them outIn relation to the previous statement, if there are no megabytes anymore, why not retrieve them from the history? Or use a tasklistener for the process end event and do something with them then (e.g. copy them to some other place…
I should mention that I love the productMe to 🙂
05-25-2011 01:24 AM
In relation to the previous statement, if there are no megabytes anymore, why not retrieve them from the history?
Or use a tasklistener for the process end event and do something with them then (e.g. copy them to some other place…
05-25-2011 11:22 AM
is there a way to only specify certain variables?
you're very correct in that the error messages themselves are very small, but the remaining variables may be large.So you do have megabytes of processvariables PER instance? Wow… are you sure you cannot 'refactor' that?
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.