12-10-2012 11:40 AM
void setVariable(String executionId, String variableName, Object value);
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
@Autowired
RuntimeService runtimeService;
@Autowired
ProcessInstance processInstance;
.12-11-2012 02:23 AM
12-11-2012 05:04 AM
The runtimeservice can be autowired, but the process instance not.
But in any case, the runtimservice should not be null. Is the bean you are injecting it in, also defined in Spring? Do you use component scanning (ie is it enabled?)
<context:annotation-config />
was missed into applicationContext.xml.<bean id="formPropertyRendererManager" class="org.activiti.explorer.ui.form.FormPropertyRendererManager" lazy-init="true">
<!– Default renderer –>
<property name="noTypePropertyRenderer">
<bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
</property>
<!– Renderers by property type –>
<property name="propertyRenderers">
<list>
<bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
…
<bean class="com.myspace.ui.renderer.DoubleFormPropertyRenderer" />
</list>
</property>
</bean>
)
12-18-2012 11:06 AM
How retrieve the execution Id, if the change of the process variables need to be realized inside of UI.Renderer context???
12-18-2012 11:18 AM
You can't get the process instance injected, that works only for service tasks or expressions.How retrieve the execution Id, if the change of the process variables need to be realized inside of UI.Renderer context???
That's not necessary, if you hook in the custom renderer, it will automatically be saved to a process variable.
…………..
<exclusiveGateway id="requestApprovedDecision" name="Request approved?" />
<sequenceFlow id="flow3" sourceRef="requestApprovedDecision" targetRef="sendApprovalMail">
<conditionExpression xsi:type="tFormalExpression">${vacationApproved == 'true'}</conditionExpression>
</sequenceFlow>
…………
After i deploy the whole vacation request bpmn file, the 2 checkboxs appears - like following pseudogui/** Update or create a variable for an execution. If the variable is not already existing somewhere in the execution hierarchy,
* it will be created in the process instance (which is the root execution).
* @param executionId id of execution to set variable in, cannot be null.
* @param variableName name of variable to set, cannot be null.
* @param value value to set. When null is passed, the variable is not removed,
* only it's value will be set to null.
* @throws ActivitiException when no execution is found for the given executionId.
*/
void setVariable(String executionId, String variableName, Object value);
/** Update or create a variable for an execution (not considering parent scopes).
* If the variable is not already existing, it will be created in the given execution.
* @param executionId id of execution to set variable in, cannot be null.
* @param variableName name of variable to set, cannot be null.
* @param value value to set. When null is passed, the variable is not removed,
* only it's value will be set to null.
* @throws ActivitiException when no execution is found for the given executionId. */
void setVariableLocal(String executionId, String variableName, Object value);
12-19-2012 03:38 AM
12-19-2012 05:51 AM
You can use the process instance id as "executionId" value, the process-instance is an execution itself…Hi frederikheremans,
frederikheremans
Post subject: Re: Question considering process correlation
Posted: Mon Jul 23, 2012 7:56 am
Joined: Thu Aug 26, 2010 6:59 am
Posts: 1595
Location: Aarschot, Belgium
Use the business-key to correlate between an unique ID and a process-instance. When starting the process, you can pass that in. Afterwards, you can query for the process-instance OR child-executions using executionQuery.processInstanceBusinessKey(…).
A process-instance is indeed an "execution", it's the ROOT execution for a running process. When a process splits into 2 parallel paths or needs a sub-scope (e.g.. subprocess), one or more child-executions are created. These executions reference the process-instance. On a ProcessInstance object, you can get the "process definition id", on an execution, you can't do this directly (can be done using the process-instance-id however). The business-key is a globally UNIQUE identifier YOU can give to a certain process. This key is not used by activiti, this uses the internal ID's. The business-key allows you to lookup a process-instance based on some key your business uses (hence the term).
In case of call-activities, you'll have a process-instance for your main process (game loop) and one for your call-activity. Potentially, there are more executions in between them, depending in the type of process.
Hopes this helps.
Are executionId and processInstaceId always the same?
jbarrez
Post subject: Re: Are executionId and processInstaceId always the same?
Posted: Wed Oct 24, 2012 7:05 am
Joined: Sun May 16, 2010 12:14 pm
Posts: 1690
Location: Belgium
No, depending on the complexity of your process you will have multiple executions (eg for each parallel path, for each scope, ect.) as child of the process instance or even nested.
try {
ExecutionContext executionContext = org.activiti.engine.impl.context.Context.getExecutionContext();
if (executionContext == null) {
System.out.println("executionContext is NULL");
} else {
System.out.println("executionContext is not null");
ExecutionEntity execution = executionContext.getExecution();
if (execution == null) {
} else {
System.out.println("execution getId " + execution.getId());
System.out.println("execution getProcessInstanceId " + execution.getProcessInstanceId());
System.out.println("execution getProcessDefinitionId " + execution.getProcessDefinitionId());
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
12-21-2012 04:36 AM
protected void initTaskForm() {
// Check if task requires a form
TaskFormData formData = formService.getTaskFormData(task.getId());
if(formData != null && formData.getFormProperties() != null && formData.getFormProperties().size() > 0) {
taskForm = new FormPropertiesForm();
taskForm.setSubmitButtonCaption(i18nManager.getMessage(Messages.TASK_COMPLETE));
taskForm.setCancelButtonCaption(i18nManager.getMessage(Messages.TASK_RESET_FORM));
taskForm.setFormHelp(i18nManager.getMessage(Messages.TASK_FORM_HELP));
taskForm.setFormProperties(formData.getFormProperties());
12-21-2012 05:29 AM
Now I understand your issue… The form-properties are rendered outside of the activiti-context, so it makes sense the Context throws and EmptyStackEx……Thank you very much 8-) I have created the wish in jira http://jira.codehaus.org/browse/ACT-1500
The class org.activiti.explorer.ui.form.FormPropertiesForm only receives the form-properties and no process-context. Your use case makes sense, though. If you want, you could add a processInstanceId and executionId (which may be null) to the render() method of form-properties and make sure it's passed from initiTaskForm() in TaskDetailPanel, al the way down to the actual render call. If you create a pull-request for this, I'm happy to accept it…
12-21-2012 08:29 AM
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.