mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
WCM Content Launch:
- submit process now allows for delayed submissions (launch date may be entered during submit) - in case of delayed submission, initiator is sent "submission pending" task with actions for cancelling submission and submitting now. On launch date, submission is made, removing "pending" task from initiator. - approved task is now submitted task Fixes to jBPM Timers: - fix to ensure task is ended when associated timer is fired - fix to ensure Alfresco transaction is active when triggered node action is executed git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5687 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -111,22 +111,59 @@
|
||||
<!-- -->
|
||||
|
||||
<decision name="endreview">
|
||||
<transition name="rejected" to="rejected">
|
||||
<action class="org.alfresco.repo.avm.wf.AVMClearSubmittedHandler"/>
|
||||
</transition>
|
||||
<transition name="approved" to="approved">
|
||||
<transition name="rejected" to="rejected" />
|
||||
<transition name="approved" to="onapprove">
|
||||
<condition>#{wcmwf_approveCnt == wcmwf_reviewerCnt}</condition>
|
||||
<action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
|
||||
</transition>
|
||||
</decision>
|
||||
|
||||
<decision name="onapprove">
|
||||
<transition name="launchnow" to="submitted" />
|
||||
<transition name="launchpending" to="submitpending">
|
||||
<condition>#{wcmwf_launchDate != null}</condition>
|
||||
</transition>
|
||||
</decision>
|
||||
|
||||
<task-node name="rejected">
|
||||
<event type="node-enter">
|
||||
<action class="org.alfresco.repo.avm.wf.AVMClearSubmittedHandler"/>
|
||||
</event>
|
||||
<task name="wcmwf:rejectedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
<task-node name="approved">
|
||||
<task name="wcmwf:approvedTask" swimlane="initiator" />
|
||||
<task-node name="submitpending">
|
||||
<task name="wcmwf:submitpendingTask" swimlane="initiator">
|
||||
<event type="task-create">
|
||||
<script>
|
||||
taskInstance.dueDate = wcmwf_launchDate;
|
||||
</script>
|
||||
</event>
|
||||
<timer duedate="#{wcmwf_launchDate}" transition="launch" >
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
logger.log("WCM Submission " + bpm_workflowDescription + " submitted at " + wcmwf_launchDate + " by " + person.properties.userName);
|
||||
</script>
|
||||
</action>
|
||||
</timer>
|
||||
</task>
|
||||
<transition name="cancel" to="submitcancelled" />
|
||||
<transition name="launch" to="submitted" />
|
||||
</task-node>
|
||||
|
||||
<task-node name="submitcancelled">
|
||||
<event type="node-enter">
|
||||
<action class="org.alfresco.repo.avm.wf.AVMClearSubmittedHandler"/>
|
||||
</event>
|
||||
<task name="wcmwf:submitcancelledTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
<task-node name="submitted">
|
||||
<event type="node-enter">
|
||||
<action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
|
||||
</event>
|
||||
<task name="wcmwf:submittedTask" swimlane="initiator" />
|
||||
<transition name="" to="end" />
|
||||
</task-node>
|
||||
|
||||
|
@@ -14,6 +14,10 @@ wcmwf_submit.node.parallelreview.transition.reject.title=Reject
|
||||
wcmwf_submit.node.parallelreview.transition.reject.description=Reject
|
||||
wcmwf_submit.node.parallelreview.transition.approve.title=Approve
|
||||
wcmwf_submit.node.parallelreview.transition.approve.description=Approve
|
||||
wcmwf_submit.node.submitpending.transition.cancel.title=Abort Submission
|
||||
wcmwf_submit.node.submitpending.transition.cancel.description=Abort Submission
|
||||
wcmwf_submit.node.submitpending.transition.launch.title=Submit Now
|
||||
wcmwf_submit.node.submitpending.transition.launch.description=Submit Now
|
||||
|
||||
# Submit Task Definitions
|
||||
|
||||
@@ -25,6 +29,12 @@ wcmwf_workflowmodel.type.wcmwf_rejectedTask.title=Rejected
|
||||
wcmwf_workflowmodel.type.wcmwf_rejectedTask.description=Rejected
|
||||
wcmwf_workflowmodel.type.wcmwf_approvedTask.title=Approved
|
||||
wcmwf_workflowmodel.type.wcmwf_approvedTask.description=Approved
|
||||
wcmwf_workflowmodel.type.wcmwf_submittedTask.title=Submitted
|
||||
wcmwf_workflowmodel.type.wcmwf_submittedTask.description=Submitted
|
||||
wcmwf_workflowmodel.type.wcmwf_submitpendingTask.title=Submission Pending
|
||||
wcmwf_workflowmodel.type.wcmwf_submitpendingTask.description=Submission Pending
|
||||
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.title=Submission Aborted
|
||||
wcmwf_workflowmodel.type.wcmwf_submitcancelledTask.description=Submission Aborted
|
||||
|
||||
wcmwf_workflowmodel.property.wcmwf_reviewType.title=Type of Review
|
||||
wcmwf_workflowmodel.property.wcmwf_reviewType.description=Serial or parallel review
|
||||
|
@@ -96,7 +96,38 @@
|
||||
</mandatory-aspects>
|
||||
</type>
|
||||
|
||||
<type name="wcmwf:approvedTask">
|
||||
<type name="wcmwf:submitpendingTask">
|
||||
<parent>wcmwf:workflowTask</parent>
|
||||
<mandatory-aspects>
|
||||
<aspect>bpm:assignees</aspect>
|
||||
<aspect>wcmwf:reviewType</aspect>
|
||||
<aspect>wcmwf:reviewInfo</aspect>
|
||||
<aspect>wcmwf:submission</aspect>
|
||||
</mandatory-aspects>
|
||||
</type>
|
||||
|
||||
<type name="wcmwf:submitcancelledTask">
|
||||
<parent>wcmwf:workflowTask</parent>
|
||||
<mandatory-aspects>
|
||||
<aspect>bpm:assignees</aspect>
|
||||
<aspect>wcmwf:reviewType</aspect>
|
||||
<aspect>wcmwf:reviewInfo</aspect>
|
||||
<aspect>wcmwf:submission</aspect>
|
||||
</mandatory-aspects>
|
||||
</type>
|
||||
|
||||
<type name="wcmwf:submittedTask">
|
||||
<parent>wcmwf:workflowTask</parent>
|
||||
<mandatory-aspects>
|
||||
<aspect>bpm:assignees</aspect>
|
||||
<aspect>wcmwf:reviewType</aspect>
|
||||
<aspect>wcmwf:reviewInfo</aspect>
|
||||
<aspect>wcmwf:submission</aspect>
|
||||
</mandatory-aspects>
|
||||
</type>
|
||||
|
||||
<!-- NOTE: kept for backwards compatibility only - for v2.0 wcm submit process definition -->
|
||||
<type name="wcmwf:approvedTask">
|
||||
<parent>wcmwf:workflowTask</parent>
|
||||
<mandatory-aspects>
|
||||
<aspect>bpm:assignees</aspect>
|
||||
|
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.repo.workflow.jbpm;
|
||||
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jbpm.job.executor.JobExecutor;
|
||||
import org.springframework.beans.factory.access.BeanFactoryLocator;
|
||||
import org.springframework.beans.factory.access.BeanFactoryReference;
|
||||
import org.springmodules.workflow.jbpm31.JbpmFactoryLocator;
|
||||
|
||||
|
||||
/**
|
||||
* jBPM Job Executor
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class AlfrescoJobExecutor extends JobExecutor
|
||||
{
|
||||
private static final long serialVersionUID = -4576396495395482111L;
|
||||
|
||||
private static Log log = LogFactory.getLog(JobExecutor.class);
|
||||
private TransactionService transactionService;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public AlfrescoJobExecutor()
|
||||
{
|
||||
BeanFactoryLocator factoryLocator = new JbpmFactoryLocator();
|
||||
BeanFactoryReference factory = factoryLocator.useBeanFactory(null);
|
||||
transactionService = (TransactionService)factory.getFactory().getBean(ServiceRegistry.TRANSACTION_SERVICE.getLocalName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Transaction Service
|
||||
*
|
||||
* @return transaction service
|
||||
*/
|
||||
public TransactionService getTransactionService()
|
||||
{
|
||||
return transactionService;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.jbpm.job.executor.JobExecutor#startThread()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected synchronized void startThread()
|
||||
{
|
||||
String threadName = getNextThreadName();
|
||||
Thread thread = new AlfrescoJobExecutorThread(threadName, this, getJbpmConfiguration(), getIdleInterval(), getMaxIdleInterval(), getMaxLockTime(), getHistoryMaxSize());
|
||||
getThreads().put(threadName, thread);
|
||||
log.debug("starting new job executor thread '" + threadName + "'");
|
||||
thread.start();
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
*/
|
||||
package org.alfresco.repo.workflow.jbpm;
|
||||
|
||||
import org.alfresco.repo.transaction.TransactionUtil;
|
||||
import org.jbpm.JbpmConfiguration;
|
||||
import org.jbpm.job.Job;
|
||||
import org.jbpm.job.executor.JobExecutorThread;
|
||||
|
||||
|
||||
/**
|
||||
* Alfresco Job Executor Thread
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class AlfrescoJobExecutorThread extends JobExecutorThread
|
||||
{
|
||||
private AlfrescoJobExecutor alfrescoJobExecutor;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param name
|
||||
* @param jobExecutor
|
||||
* @param jbpmConfiguration
|
||||
* @param idleInterval
|
||||
* @param maxIdleInterval
|
||||
* @param maxLockTime
|
||||
* @param maxHistory
|
||||
*/
|
||||
public AlfrescoJobExecutorThread(String name, AlfrescoJobExecutor jobExecutor, JbpmConfiguration jbpmConfiguration, int idleInterval, int maxIdleInterval, long maxLockTime, int maxHistory)
|
||||
{
|
||||
super(name, jobExecutor, jbpmConfiguration, idleInterval, maxIdleInterval, maxLockTime, maxHistory);
|
||||
this.alfrescoJobExecutor = jobExecutor;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.jbpm.job.executor.JobExecutorThread#executeJob(org.jbpm.job.Job)
|
||||
*/
|
||||
@Override
|
||||
protected void executeJob(Job job)
|
||||
{
|
||||
TransactionUtil.executeInUserTransaction(alfrescoJobExecutor.getTransactionService(), new TransactionJob(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class for holding Job reference
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
private class TransactionJob implements TransactionUtil.TransactionWork<Object>
|
||||
{
|
||||
private Job job;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param job
|
||||
*/
|
||||
public TransactionJob(Job job)
|
||||
{
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.transaction.TransactionUtil.TransactionWork#doWork()
|
||||
*/
|
||||
public Object doWork() throws Throwable
|
||||
{
|
||||
AlfrescoJobExecutorThread.super.executeJob(job);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -25,7 +25,7 @@
|
||||
<bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
|
||||
<bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
|
||||
|
||||
<bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
|
||||
<bean name="jbpm.job.executor" class="org.alfresco.repo.workflow.jbpm.AlfrescoJobExecutor">
|
||||
<field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
|
||||
<field name="name"><string value="AlfrescoJbpmJobExector" /></field>
|
||||
<field name="nbrOfThreads"><int value="1" /></field>
|
||||
|
@@ -35,9 +35,21 @@
|
||||
</timer>
|
||||
</task>
|
||||
<transition name="cancel" to="end" /> <!-- signalling this transition will cancel timer -->
|
||||
<transition name="launched" to="end" /> <!-- signalling this transition will cancel timer -->
|
||||
<transition name="launched" to="doit" /> <!-- signalling this transition will cancel timer -->
|
||||
</task-node>
|
||||
|
||||
<node name="doit">
|
||||
<event type="node-enter">
|
||||
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
|
||||
<script>
|
||||
companyhome.name = companyhome.name + "b";
|
||||
logger.log("Company Home: " + companyhome.name);
|
||||
</script>
|
||||
</action>
|
||||
</event>
|
||||
<transition name="" to="end" />
|
||||
</node>
|
||||
|
||||
<end-state name="end" />
|
||||
|
||||
</process-definition>
|
Reference in New Issue
Block a user