mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Here's a skeletal workflow for the Gartner demo. Doesn't do anything besides
printing a log message and showing up appropriately in task lists. The task screens aren't quite delectable but they show up. Fixed a misplaced store level property and added a new one ".website.name" to user sandbox stores so that the corresponding staging sandbox can be determined efficiently from a user sandbox. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3870 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -420,6 +420,8 @@
|
|||||||
<value>alfresco/model/applicationModel.xml</value>
|
<value>alfresco/model/applicationModel.xml</value>
|
||||||
<value>alfresco/model/forumModel.xml</value>
|
<value>alfresco/model/forumModel.xml</value>
|
||||||
<value>alfresco/model/recordsModel.xml</value>
|
<value>alfresco/model/recordsModel.xml</value>
|
||||||
|
<value>alfresco/model/bpmModel.xml</value>
|
||||||
|
<value>alfresco/model/workflowModel.xml</value>
|
||||||
|
|
||||||
<!-- Implementation models -->
|
<!-- Implementation models -->
|
||||||
<value>org/alfresco/repo/security/authentication/userModel.xml</value>
|
<value>org/alfresco/repo/security/authentication/userModel.xml</value>
|
||||||
|
15
config/alfresco/extension/wcmwf-model-context.xml
Normal file
15
config/alfresco/extension/wcmwf-model-context.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
|
<beans>
|
||||||
|
|
||||||
|
<!-- Registration of new models -->
|
||||||
|
<bean id="wcmwf.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
|
||||||
|
<property name="models">
|
||||||
|
<list>
|
||||||
|
<value>alfresco/workflow/wcmSubmitModel.xml</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
@@ -22,6 +22,12 @@
|
|||||||
<prop key="mimetype">text/xml</prop>
|
<prop key="mimetype">text/xml</prop>
|
||||||
<prop key="redeploy">false</prop>
|
<prop key="redeploy">false</prop>
|
||||||
</props>
|
</props>
|
||||||
|
<props>
|
||||||
|
<prop key="engineId">jbpm</prop>
|
||||||
|
<prop key="location">alfresco/workflow/wcmSubmit.xml</prop>
|
||||||
|
<prop key="mimetype">text/xml</prop>
|
||||||
|
<prop key="redeploy">false</prop>
|
||||||
|
</props>
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
41
config/alfresco/workflow/wcmSubmit.xml
Normal file
41
config/alfresco/workflow/wcmSubmit.xml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!-- This describes a process for submitting changed content in a user -->
|
||||||
|
<!-- sandbox, via an approver, to the staging sandbox. -->
|
||||||
|
|
||||||
|
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wcmwf:submit">
|
||||||
|
|
||||||
|
<swimlane name="initiator"/>
|
||||||
|
|
||||||
|
<start-state name="start">
|
||||||
|
<task name="wcmwf:startSubmit" swimlane="initiator">
|
||||||
|
<controller>
|
||||||
|
<variable name="assignee" access="write" mapped-name="wcmwf:assignee"/>
|
||||||
|
<variable name="description" access="write" mapped-name="wcmwf:description"/>
|
||||||
|
<variable name="sourcePath" access="write" mapped-name="wcmwf:sourcePath"/>
|
||||||
|
<variable name="workflowcontext" access="write" mapped-name="bpm:context"/>
|
||||||
|
</controller>
|
||||||
|
</task>
|
||||||
|
<transition name="" to="review"/>
|
||||||
|
</start-state>
|
||||||
|
|
||||||
|
<swimlane name="assignee">
|
||||||
|
<assignment actor-id="#{assignee.properties['cm:userName']}"/>
|
||||||
|
</swimlane>
|
||||||
|
|
||||||
|
<task-node name="review">
|
||||||
|
<task name="wcmwf:review" swimlane="assignee">
|
||||||
|
<controller>
|
||||||
|
<variable name="description" access="read" mapped-name="wcmwf:description"/>
|
||||||
|
<variable name="sourcePath" access="read" mapped-name="wcmwf:sourcePath"/>
|
||||||
|
<variable name="workflowcontext" access="write" mapped-name="bpm:context"/>
|
||||||
|
</controller>
|
||||||
|
</task>
|
||||||
|
<transition name="approve" to="end">
|
||||||
|
<action class="org.alfresco.repo.avm.wf.AVMSubmitHandler"/>
|
||||||
|
</transition>
|
||||||
|
</task-node>
|
||||||
|
|
||||||
|
<end-state name="end"/>
|
||||||
|
|
||||||
|
</process-definition>
|
63
config/alfresco/workflow/wcmSubmitModel.xml
Normal file
63
config/alfresco/workflow/wcmSubmitModel.xml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<model name="wcmwf:submitmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
||||||
|
|
||||||
|
<imports>
|
||||||
|
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
|
||||||
|
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
|
||||||
|
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
|
||||||
|
</imports>
|
||||||
|
|
||||||
|
<namespaces>
|
||||||
|
<namespace uri="http://www/alfresco.org/model/wcmwf/1.0" prefix="wcmwf"/>
|
||||||
|
</namespaces>
|
||||||
|
|
||||||
|
<types>
|
||||||
|
<type name="wcmwf:baseSubmitTask">
|
||||||
|
<parent>bpm:workflowTask</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<property name="wcmwf:description">
|
||||||
|
<title>Description</title>
|
||||||
|
<type>d:text</type>
|
||||||
|
</property>
|
||||||
|
|
||||||
|
<property name="wcmwf:sourcePath">
|
||||||
|
<title>Source Sandbox Path</title>
|
||||||
|
<type>d:text</type>
|
||||||
|
</property>
|
||||||
|
</properties>
|
||||||
|
</type>
|
||||||
|
|
||||||
|
<type name="wcmwf:startSubmit">
|
||||||
|
<parent>wcmwf:baseSubmitTask</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<property name="wcmwf:submitDueDate">
|
||||||
|
<title>Due Date</title>
|
||||||
|
<type>d:date</type>
|
||||||
|
</property>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<associations>
|
||||||
|
<association name="wcmwf:assignee">
|
||||||
|
<title>Assignee</title>
|
||||||
|
<source>
|
||||||
|
<mandatory>false</mandatory>
|
||||||
|
<many>false</many>
|
||||||
|
</source>
|
||||||
|
<target>
|
||||||
|
<class>cm:person</class>
|
||||||
|
<mandatory>true</mandatory>
|
||||||
|
<many>false</many>
|
||||||
|
</target>
|
||||||
|
</association>
|
||||||
|
</associations>
|
||||||
|
</type>
|
||||||
|
|
||||||
|
<type name="wcmwf:review">
|
||||||
|
<title>Review</title>
|
||||||
|
<parent>wcmwf:baseSubmitTask</parent>
|
||||||
|
</type>
|
||||||
|
</types>
|
||||||
|
</model>
|
68
source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java
Normal file
68
source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2006 Alfresco, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Mozilla Public License version 1.1
|
||||||
|
* with a permitted attribution clause. You may obtain a
|
||||||
|
* copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.alfresco.org/legal/license.txt
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||||
|
* either express or implied. See the License for the specific
|
||||||
|
* language governing permissions and limitations under the
|
||||||
|
* License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.alfresco.repo.avm.wf;
|
||||||
|
|
||||||
|
import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler;
|
||||||
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
|
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.jbpm.graph.exe.ExecutionContext;
|
||||||
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs a 'submit' operation: update from one sandbox layer to
|
||||||
|
* its corresponding staging sandbox.
|
||||||
|
* @author britt
|
||||||
|
*/
|
||||||
|
public class AVMSubmitHandler extends JBPMSpringActionHandler
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 7561005904505181493L;
|
||||||
|
|
||||||
|
private static Logger fgLogger = Logger.getLogger(AVMSubmitHandler.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AVMSyncService.
|
||||||
|
*/
|
||||||
|
private AVMSyncService fAVMSyncService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AVMService.
|
||||||
|
*/
|
||||||
|
private AVMService fAVMService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set any bean references necessary.
|
||||||
|
* @param factory The BeanFactory from which to get beans.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void initialiseHandler(BeanFactory factory)
|
||||||
|
{
|
||||||
|
fAVMSyncService = (AVMSyncService)factory.getBean("AVMSyncService");
|
||||||
|
fAVMService = (AVMService)factory.getBean("AVMService");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do the actual submit work.
|
||||||
|
* @param executionContext The jBPM context.
|
||||||
|
*/
|
||||||
|
public void execute(ExecutionContext executionContext) throws Exception
|
||||||
|
{
|
||||||
|
String avmSource = (String)executionContext.getContextInstance().getVariable("sourcePath");
|
||||||
|
fgLogger.error("Would be submittting: " + avmSource);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user