mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V3.1 to HEAD
12992: Merged V3.0 to V3.1 12930: Merged V2.2 to V3.0 12713: Fix one part of ETWOTWO-975 (submit conflicts silently fail) ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.0:r12930 Merged /alfresco/BRANCHES/V2.2:r12713 Merged /alfresco/BRANCHES/V3.1:r12992 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13548 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1648,4 +1648,27 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<!-- Redeploy both direct and indirect submit processes for addition submit failure handling -->
|
||||||
|
<bean id="patch.redeploySubmitProcess6" class="org.alfresco.repo.admin.patch.impl.GenericWorkflowPatch" parent="basePatch" >
|
||||||
|
<property name="id"><value>patch.redeploySubmitProcess6</value></property>
|
||||||
|
<property name="description"><value>patch.redeploySubmitProcess.description</value></property>
|
||||||
|
<property name="fixesFromSchema"><value>0</value></property>
|
||||||
|
<property name="fixesToSchema"><value>2002</value></property>
|
||||||
|
<property name="targetSchema"><value>2003</value></property>
|
||||||
|
<property name="workflowDefinitions">
|
||||||
|
<list>
|
||||||
|
<props>
|
||||||
|
<prop key="engineId">jbpm</prop>
|
||||||
|
<prop key="location">alfresco/workflow/submit_processdefinition.xml</prop>
|
||||||
|
<prop key="mimetype">text/xml</prop>
|
||||||
|
</props>
|
||||||
|
<props>
|
||||||
|
<prop key="engineId">jbpm</prop>
|
||||||
|
<prop key="location">alfresco/workflow/submitdirect_processdefinition.xml</prop>
|
||||||
|
<prop key="mimetype">text/xml</prop>
|
||||||
|
</props>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -19,4 +19,4 @@ version.build=@build-number@
|
|||||||
|
|
||||||
# Schema number
|
# Schema number
|
||||||
|
|
||||||
version.schema=2002
|
version.schema=2003
|
||||||
|
@@ -225,6 +225,11 @@
|
|||||||
</timer>
|
</timer>
|
||||||
|
|
||||||
<event type="task-end">
|
<event type="task-end">
|
||||||
|
<script>
|
||||||
|
<variable name="submitfailed" access="write"/>
|
||||||
|
<expression>submitfailed = false;</expression>
|
||||||
|
</script>
|
||||||
|
|
||||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||||
<script>
|
<script>
|
||||||
logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
||||||
@@ -240,11 +245,33 @@
|
|||||||
</script>
|
</script>
|
||||||
</action>
|
</action>
|
||||||
</event>
|
</event>
|
||||||
|
|
||||||
</task>
|
</task>
|
||||||
<transition name="" to="end" />
|
<transition name="" to="checkfailedsubmit">
|
||||||
|
<exception-handler>
|
||||||
|
<script>
|
||||||
|
<variable name="submitfailed" access="write"/>
|
||||||
|
<expression>
|
||||||
|
logger.log("WCM Submit Process: Submit failed for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
||||||
|
submitfailed = true;
|
||||||
|
</expression>
|
||||||
|
</script>
|
||||||
|
</exception-handler>
|
||||||
|
</transition>
|
||||||
</task-node>
|
</task-node>
|
||||||
|
|
||||||
|
<decision name="checkfailedsubmit">
|
||||||
|
<transition name="failure" to="submitfailed">
|
||||||
|
<condition>#{submitfailed == true}</condition>
|
||||||
|
</transition>
|
||||||
|
<transition name="success" to="end">
|
||||||
|
<condition>#{submitfailed == false}</condition>
|
||||||
|
</transition>
|
||||||
|
</decision>
|
||||||
|
|
||||||
|
<task-node name="submitfailed">
|
||||||
|
<task name="wcmwf:submitfailedTask" swimlane="initiator"/>
|
||||||
|
<transition name="" to="end"/>
|
||||||
|
</task-node>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- End the Process -->
|
<!-- End the Process -->
|
||||||
|
@@ -26,6 +26,11 @@
|
|||||||
</timer>
|
</timer>
|
||||||
|
|
||||||
<event type="task-end">
|
<event type="task-end">
|
||||||
|
<script>
|
||||||
|
<variable name="submitfailed" access="write"/>
|
||||||
|
<expression>submitfailed = false;</expression>
|
||||||
|
</script>
|
||||||
|
|
||||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||||
<script>
|
<script>
|
||||||
logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
||||||
@@ -41,9 +46,32 @@
|
|||||||
</script>
|
</script>
|
||||||
</action>
|
</action>
|
||||||
</event>
|
</event>
|
||||||
|
|
||||||
</task>
|
</task>
|
||||||
<transition name="" to="end" />
|
<transition name="" to="checkfailedsubmit">
|
||||||
|
<exception-handler>
|
||||||
|
<script>
|
||||||
|
<variable name="submitfailed" access="write"/>
|
||||||
|
<expression>
|
||||||
|
logger.log("WCM Submit Process: Submit failed for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
|
||||||
|
submitfailed = true;
|
||||||
|
</expression>
|
||||||
|
</script>
|
||||||
|
</exception-handler>
|
||||||
|
</transition>
|
||||||
|
</task-node>
|
||||||
|
|
||||||
|
<decision name="checkfailedsubmit">
|
||||||
|
<transition name="failure" to="submitfailed">
|
||||||
|
<condition>#{submitfailed == true}</condition>
|
||||||
|
</transition>
|
||||||
|
<transition name="success" to="end">
|
||||||
|
<condition>#{submitfailed == false}</condition>
|
||||||
|
</transition>
|
||||||
|
</decision>
|
||||||
|
|
||||||
|
<task-node name="submitfailed">
|
||||||
|
<task name="wcmwf:submitfailedTask" swimlane="initiator"/>
|
||||||
|
<transition name="" to="end"/>
|
||||||
</task-node>
|
</task-node>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
@@ -55,6 +55,8 @@ wcmwf_workflowmodel.type.wcmwf_submitpendingTask.title=Submission Pending
|
|||||||
wcmwf_workflowmodel.type.wcmwf_submitpendingTask.description=Submission Pending
|
wcmwf_workflowmodel.type.wcmwf_submitpendingTask.description=Submission Pending
|
||||||
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.title=Submission Aborted
|
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.title=Submission Aborted
|
||||||
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.description=Submission Aborted
|
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.description=Submission Aborted
|
||||||
|
wcmwf_workflowmodel.type.wcmwf_submitfailedTask.title=Submission Failed
|
||||||
|
wcmwf_workflowmodel.type.wcmwf_submitfailedTask.description=Submission Failed
|
||||||
|
|
||||||
wcmwf_workflowmodel.property.wcmwf_reviewType.title=Type of Review
|
wcmwf_workflowmodel.property.wcmwf_reviewType.title=Type of Review
|
||||||
wcmwf_workflowmodel.property.wcmwf_reviewType.description=Serial or parallel review
|
wcmwf_workflowmodel.property.wcmwf_reviewType.description=Serial or parallel review
|
||||||
|
@@ -172,6 +172,13 @@
|
|||||||
</mandatory-aspects>
|
</mandatory-aspects>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
|
<type name="wcmwf:submitfailedTask">
|
||||||
|
<parent>wcmwf:workflowTask</parent>
|
||||||
|
<mandatory-aspects>
|
||||||
|
<aspect>wcmwf:submission</aspect>
|
||||||
|
</mandatory-aspects>
|
||||||
|
</type>
|
||||||
|
|
||||||
<!-- NOTE: kept for backwards compatibility only - for v2.0 wcm submit process definition -->
|
<!-- NOTE: kept for backwards compatibility only - for v2.0 wcm submit process definition -->
|
||||||
<type name="wcmwf:approvedTask">
|
<type name="wcmwf:approvedTask">
|
||||||
<parent>wcmwf:workflowTask</parent>
|
<parent>wcmwf:workflowTask</parent>
|
||||||
|
@@ -108,18 +108,9 @@ public class AVMSubmitPackageHandler extends JBPMSpringActionHandler implements
|
|||||||
final String tag = (String) executionContext.getContextInstance().getVariable("wcmwf_label");
|
final String tag = (String) executionContext.getContextInstance().getVariable("wcmwf_label");
|
||||||
|
|
||||||
final Map<QName, PropertyValue> dnsProperties = this.fAVMService.queryStorePropertyKey(targetPath.split(":")[0], QName.createQName(null, ".dns%"));
|
final Map<QName, PropertyValue> dnsProperties = this.fAVMService.queryStorePropertyKey(targetPath.split(":")[0], QName.createQName(null, ".dns%"));
|
||||||
String webProject = dnsProperties.keySet().iterator().next().getLocalName();
|
String localName = dnsProperties.keySet().iterator().next().getLocalName();
|
||||||
webProject = webProject.substring(webProject.lastIndexOf('.') + 1, webProject.length());
|
final String webProject = localName.substring(localName.lastIndexOf('.') + 1, localName.length());
|
||||||
final List<AVMDifference> stagingDiffs = fAVMSyncService.compare(pkgPath.getFirst(), pkgPath.getSecond(), -1, targetPath, null);
|
final List<AVMDifference> stagingDiffs = fAVMSyncService.compare(pkgPath.getFirst(), pkgPath.getSecond(), -1, targetPath, null);
|
||||||
for (final AVMDifference diff : stagingDiffs)
|
|
||||||
{
|
|
||||||
String p = diff.getSourcePath();
|
|
||||||
if (from != null && from.length() != 0)
|
|
||||||
{
|
|
||||||
p = from + p.substring(pkgPath.getSecond().length());
|
|
||||||
}
|
|
||||||
this.recursivelyRemoveLocks(webProject, -1, p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow AVMSubmitTransactionListener to inspect the staging diffs
|
// Allow AVMSubmitTransactionListener to inspect the staging diffs
|
||||||
// so it can notify the virtualization server via JMX if when this
|
// so it can notify the virtualization server via JMX if when this
|
||||||
@@ -134,13 +125,22 @@ public class AVMSubmitPackageHandler extends JBPMSpringActionHandler implements
|
|||||||
// may not have permission to flatten the store the workflow was submitted from
|
// may not have permission to flatten the store the workflow was submitted from
|
||||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
|
|
||||||
public Object doWork() throws Exception
|
public Object doWork() throws Exception
|
||||||
{
|
{
|
||||||
fAVMSyncService.update(stagingDiffs, null, false, false, true, true, tag, description);
|
fAVMSyncService.update(stagingDiffs, null, false, false, true, true, tag, description);
|
||||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||||
fAVMSyncService.flatten(pkgPath.getSecond(), targetPath);
|
fAVMSyncService.flatten(pkgPath.getSecond(), targetPath);
|
||||||
|
|
||||||
|
for (final AVMDifference diff : stagingDiffs)
|
||||||
|
{
|
||||||
|
String p = diff.getSourcePath();
|
||||||
|
if (from != null && from.length() != 0)
|
||||||
|
{
|
||||||
|
p = from + p.substring(pkgPath.getSecond().length());
|
||||||
|
}
|
||||||
|
recursivelyRemoveLocks(webProject, -1, p);
|
||||||
|
}
|
||||||
|
|
||||||
// flatten source folder where changes were submitted from
|
// flatten source folder where changes were submitted from
|
||||||
if (from != null && from.length() > 0)
|
if (from != null && from.length() > 0)
|
||||||
{
|
{
|
||||||
|
60
source/test-resources/jbpmresources/test_exception.xml
Normal file
60
source/test-resources/jbpmresources/test_exception.xml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="test_exception">
|
||||||
|
|
||||||
|
<start-state name="start">
|
||||||
|
<task name="bpm:startTask" swimlane="initiator" />
|
||||||
|
<transition to="raiseerror"/>
|
||||||
|
</start-state>
|
||||||
|
|
||||||
|
<swimlane name="assignee">
|
||||||
|
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
|
||||||
|
<actor>#{bpm_assignee}</actor>
|
||||||
|
</assignment>
|
||||||
|
</swimlane>
|
||||||
|
|
||||||
|
<task-node name="raiseerror">
|
||||||
|
<task name="wf:workflowTask" swimlane="assignee">
|
||||||
|
<event type="task-end">
|
||||||
|
<script>
|
||||||
|
<variable name="submitexception" access="write"/>
|
||||||
|
<expression>submitexception = false;</expression>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
//raise exception!
|
||||||
|
</script>
|
||||||
|
</event>
|
||||||
|
</task>
|
||||||
|
<transition name="" to="checkexception">
|
||||||
|
</transition>
|
||||||
|
<exception-handler>
|
||||||
|
<script>
|
||||||
|
<variable name="submitexception" access="write"/>
|
||||||
|
<expression>
|
||||||
|
System.out.println("Exception");
|
||||||
|
submitexception = true
|
||||||
|
</expression>
|
||||||
|
</script>
|
||||||
|
</exception-handler>
|
||||||
|
</task-node>
|
||||||
|
|
||||||
|
<decision name="checkexception">
|
||||||
|
<event type="node-enter">
|
||||||
|
<script>System.out.println("Value = " + submitexception);</script>
|
||||||
|
</event>
|
||||||
|
<transition name="failure" to="error">
|
||||||
|
<condition>#{submitexception == true}</condition>
|
||||||
|
</transition>
|
||||||
|
<transition name="success" to="end">
|
||||||
|
<condition>#{submitexception == false}</condition>
|
||||||
|
</transition>
|
||||||
|
</decision>
|
||||||
|
|
||||||
|
<task-node name="error">
|
||||||
|
<task name="wf:workflowTask" swimlane="assignee"/>
|
||||||
|
<transition name="" to="end"/>
|
||||||
|
</task-node>
|
||||||
|
|
||||||
|
<end-state name="end"/>
|
||||||
|
|
||||||
|
</process-definition>
|
Reference in New Issue
Block a user