cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti new BAR file

hamid_gholipour
Champ in-the-making
Champ in-the-making
Hi dear
I and My programming team ,have a project BPM workflow engine designed by help Activiti BPM completed, is now on the site and of more than 200 people arrived daily workflow engine are.
But there was a bug in one of our forms!
… I After Solve the problem and deployment in my project , I got the usual one output  Bar file should I upload it to Activiti Explorer.
Now my question to you dear ones is …
When we add new Bar files without a problem to Activiti Explore, the new processes into our workflow engine will assigned be the same Bar File are new without problem (These no)!
My problem is process that earlier in assigned to the last Bar files are associated with the problem, what can I do that process prior assigned to the new Bar File without problem.
2 REPLIES 2

hamid_gholipour
Champ in-the-making
Champ in-the-making
pls help me ….

frederikherema1
Star Contributor
Star Contributor
I think you are trying to migrate existing process-instances to use a new process-definition that is deployed in the new BAR-file. Can you confirm I'm understanding you correctly?

You can use the org.activiti.engine.impl.cmd.SetProcessDefinitionVersionCmd:


/**
* {@link Command} that changes the process definition version of an existing
* process instance.
*
* Warning: This command will NOT perform any migration magic and simply set the
* process definition version in the database, assuming that the user knows,
* what he or she is doing.
*
* This is only useful for simple migrations. The new process definition MUST
* have the exact same activity id to make it still run.
*
* Furthermore, activities referenced by sub-executions and jobs that belong to
* the process instance MUST exist in the new process definition version.
*
* The command will fail, if there is already a {@link ProcessInstance} or
* {@link HistoricProcessInstance} using the new process definition version and
* the same business key as the {@link ProcessInstance} that is to be migrated.
*
* If the process instance is not currently waiting but actively running, then
* this would be a case for optimistic locking, meaning either the version
* update or the "real work" wins, i.e., this is a race condition.
*
* @see http://forums.activiti.org/en/viewtopic.php?t=2918
* @author Falko Menge
*/
public class SetProcessDefinitionVersionCmd implements Command<Void>, Serializable {


CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(pi.getId(), 2));