ActivityExecution flush a variable immediately

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 06:48 AM
Hello,
I extended the class TaskActivitiyBehavior to write a own task.
In the method "public void execute(ActivityExecution execution)" I changed a variable and started a new thread which should access the the changed variable.
execution.getVariable("A");
Change the variable from 0 to 1;
execution.setVariable("A", 1);
startNewProcessInAnotherThread();
If I try to access the variable from the new launched process the value is 0. How can I flush the value immediately?
I extended the class TaskActivitiyBehavior to write a own task.
In the method "public void execute(ActivityExecution execution)" I changed a variable and started a new thread which should access the the changed variable.
execution.getVariable("A");
Change the variable from 0 to 1;
execution.setVariable("A", 1);
startNewProcessInAnotherThread();
If I try to access the variable from the new launched process the value is 0. How can I flush the value immediately?
Labels:
- Labels:
-
Archive
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 07:08 AM
You can't because the database connection is managed by the Activiti Engine and an execution tree is persisted to the database after it reaches a wait state.
Best regards,
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 07:59 AM
Can I use the runtime service in my class to persiste the values earlier?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2015 10:25 AM
Not really, cause the process instance won't exist yet (it's also flushed at the end).
What is the use case you're trying to solve here?
What is the use case you're trying to solve here?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2015 03:44 AM
I have a task which launch 1..n new process instances depending on the configuration which is passed to the parent task. If one of my new processes fail the parent task should be stopped. I also use the parent process actually to save the state and the configuration in a object. This informations are used for visualisation.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2015 09:04 AM
Can't you use a call activity in a multi instance for this?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2015 05:54 AM
Do you have a example for a multi instance activiti?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 04:52 PM
I do. As does the documentation and our unit tests ….
