[jboss-user] [JBoss jBPM] - Re: how do we generate database migration script

apdo do-not-reply at jboss.com
Mon Mar 30 13:01:50 EDT 2009


My migration script from 3.0.1 to 3.3.1.

Use the following carefully since there is assumption on the content of my database.


update JBPM_ACTION set ISASYNC_ = 0
update JBPM_COMMENT set VERSION_ = 0 

--newString + oldStringvalue back to varchar 255?

update JBPM_MODULEINSTANCE set VERSION_ = 0

update JBPM_NODE set ISASYNC_ = 0, ISASYNCEXCL_ = 0
update JBPM_NODE set ENDTASKS_ = 0 where CLASS_ = 'K' --verifier avec Diem bizzarement il y a que 93 row
-- NOTE: SUBPROCNAME_, DECISIONEXPRESSION_, SCRIPT_ were all null in my database

update JBPM_POOLEDACTOR set VERSION_ = 0

update JBPM_PROCESSDEFINITION set CLASS_ = 'P' 
-- Note: DESCRIPTION_ is left null 

update JBPM_PROCESSINSTANCE set VERSION_ = 0, ISSUSPENDED_ = 0
--Note: KEY_ is left null
--Question: is ISSUSPENDED_ represent a cancelled process?

update JBPM_RUNTIMEACTION set VERSION_ = 0
 
/* I dont have any entries of this type in my database 
 JBPM_SWIMLANE
 Colimn ACTORIDEXPRESSION_ not in bpmtemp
 Colimn POOLEDACTORSEXPRESSION_ not in bpmtemp
*/

update JBPM_TASK set ISSIGNALLING_ = 1, PRIORITY_ = 3
 --Colimn CONDITION_, ACTORIDEXPRESSION_, POOLEDACTORSEXPRESSION_ are left null


/* update JBPM_TASKINSTANCE */
DECLARE JBPM_TASKINSTANCE_CURSOR CURSOR
FOR
select ti.ID_, ti.CREATE_, ti.END_,  PROCESSINSTANCE_
from JBPM_TASKINSTANCE as ti
inner join JBPM_TOKEN as t on (t.id_ = ti.token_)

DECLARE @taskId int
DECLARE @TaskCreate datetime
DECLARE @TaskEnd datetime 
DECLARE @pi numeric

OPEN JBPM_TASKINSTANCE_CURSOR
FETCH NEXT FROM JBPM_TASKINSTANCE_CURSOR INTO @taskId, @TaskCreate, @TaskEnd, @pi
WHILE (@@FETCH_STATUS = 0)
BEGIN
	DECLARE @isOpen tinyint
	set @isOpen = 0;

	if (@TaskEnd is null)
		set @isOpen = 1;

	update JBPM_TASKINSTANCE set CLASS_ = 'T', VERSION_ = 1, ISSUSPENDED_ = 0, ISOPEN_  = @isOpen, PROCINST_ = @pi where id_ = @taskId
	--I do not manually suspend task force 0
	
	FETCH NEXT FROM JBPM_TASKINSTANCE_CURSOR INTO @taskId, @TaskCreate, @TaskEnd, @pi
END

CLOSE JBPM_TASKINSTANCE_CURSOR
;

update JBPM_TOKEN set VERSION_ = 0, ISSUSPENDED_ = 0
 --Note: LOCK_, SUBPROCESSINSTANCE_ left null

update JBPM_TOKENVARIABLEMAP set VERSION_ = 0

/* both new column are left null
update JBPM_TRANSITION
 Colimn DESCRIPTION_ not in bpmtemp
 Colimn CONDITION_ not in bpmtemp
*/

update JBPM_VARIABLEINSTANCE set VERSION_ = 0

Let me know if you use it and found error in the script.

An Phong Do

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222076#4222076

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222076



More information about the jboss-user mailing list