mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
AR-1551 Oracle Constraint violation error submitting workflow in WCM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6156 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -55,6 +55,7 @@
|
|||||||
<ref bean="patch.db-V2.0-AVMFKIndexes" />
|
<ref bean="patch.db-V2.0-AVMFKIndexes" />
|
||||||
<ref bean="patch.db-V2.1-JBPMData" />
|
<ref bean="patch.db-V2.1-JBPMData" />
|
||||||
<ref bean="patch.db-V2.1-VersionColumns" />
|
<ref bean="patch.db-V2.1-VersionColumns" />
|
||||||
|
<ref bean="patch.db-V2.1-JBPMProcessKey" />
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
--
|
||||||
|
-- Title: Jbpm 3.2 Process Instance Key
|
||||||
|
-- Database: Generic
|
||||||
|
-- Since: V2.1 Schema 63
|
||||||
|
-- Author: David Caruana
|
||||||
|
--
|
||||||
|
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||||
|
--
|
||||||
|
|
||||||
|
UPDATE JBPM_PROCESSINSTANCE SET KEY_ = '' || ID_ WHERE KEY_ IS NULL;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Record script finish
|
||||||
|
--
|
||||||
|
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V2.1-JBPMProcessKey';
|
||||||
|
INSERT INTO alf_applied_patch
|
||||||
|
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'patch.db-V2.1-JBPMProcessKey', 'Manually executed script upgrade V2.1: JBPM 3.2 Process Instance Key',
|
||||||
|
0, 62, -1, 63, null, 'UNKOWN', 1, 1, 'Script completed'
|
||||||
|
);
|
@@ -884,4 +884,16 @@
|
|||||||
<ref bean="avmNodePropertyDAO"/>
|
<ref bean="avmNodePropertyDAO"/>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="patch.db-V2.1-JBPMProcessKey" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||||
|
<property name="id"><value>patch.db-V2.1-JBPMProcessKey</value></property>
|
||||||
|
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
|
||||||
|
<property name="fixesFromSchema"><value>0</value></property>
|
||||||
|
<property name="fixesToSchema"><value>62</value></property>
|
||||||
|
<property name="targetSchema"><value>63</value></property>
|
||||||
|
<property name="scriptUrl">
|
||||||
|
<value>classpath:alfresco/dbscripts/upgrade/2.1/${db.script.dialect}/AlfrescoSchemaUpdate-2.1-JBPMProcessKey.sql</value>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -19,4 +19,4 @@ version.build=@build-number@
|
|||||||
|
|
||||||
# Schema number
|
# Schema number
|
||||||
|
|
||||||
version.schema=62
|
version.schema=63
|
||||||
|
@@ -75,6 +75,7 @@ import org.alfresco.service.cmr.workflow.WorkflowTransition;
|
|||||||
import org.alfresco.service.namespace.NamespaceException;
|
import org.alfresco.service.namespace.NamespaceException;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.alfresco.util.GUID;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
@@ -554,6 +555,7 @@ public class JBPMEngine extends BPMEngine
|
|||||||
GraphSession graphSession = context.getGraphSession();
|
GraphSession graphSession = context.getGraphSession();
|
||||||
ProcessDefinition processDefinition = getProcessDefinition(graphSession, workflowDefinitionId);
|
ProcessDefinition processDefinition = getProcessDefinition(graphSession, workflowDefinitionId);
|
||||||
ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
ProcessInstance processInstance = new ProcessInstance(processDefinition);
|
||||||
|
processInstance.setKey(GUID.generate());
|
||||||
|
|
||||||
// assign initial process context
|
// assign initial process context
|
||||||
ContextInstance processContext = processInstance.getContextInstance();
|
ContextInstance processContext = processInstance.getContextInstance();
|
||||||
|
Reference in New Issue
Block a user