mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Workflow:
1) Add access to process definition warnings in workflow service deploy method 2) Fix nasty little bug found by Gav where jBPM beanshell access to Alfresco Node failed as it expected slightly different object types to those expected by Alfresco Javascript access to Node. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3543 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
92
source/java/org/alfresco/repo/workflow/jbpm/JBPMNode.java
Normal file
92
source/java/org/alfresco/repo/workflow/jbpm/JBPMNode.java
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005 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.workflow.jbpm;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.alfresco.service.ServiceRegistry;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.mozilla.javascript.Scriptable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scriptable Node suitable for JBPM Beanshell access
|
||||||
|
*
|
||||||
|
* TODO: This implementation derives from the JavaScript Alfresco Node. At
|
||||||
|
* some point we should look to having a script-independent node with various
|
||||||
|
* script-specific sub-types (and value conversions).
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public class JBPMNode extends org.alfresco.repo.jscript.Node
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = -826970280203254365L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct
|
||||||
|
*
|
||||||
|
* @param nodeRef node reference
|
||||||
|
* @param services services
|
||||||
|
*/
|
||||||
|
public JBPMNode(NodeRef nodeRef, ServiceRegistry services)
|
||||||
|
{
|
||||||
|
super(nodeRef, services, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.alfresco.repo.jscript.Node#createValueConverter()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected NodeValueConverter createValueConverter()
|
||||||
|
{
|
||||||
|
return new JBPMNodeConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value converter for beanshell.
|
||||||
|
*/
|
||||||
|
private class JBPMNodeConverter extends org.alfresco.repo.jscript.Node.NodeValueConverter
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Serializable convertValueForRepo(Serializable value)
|
||||||
|
{
|
||||||
|
if (value instanceof Date)
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return super.convertValueForRepo(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Serializable convertValueForScript(ServiceRegistry services, Scriptable scope, QName qname, Serializable value)
|
||||||
|
{
|
||||||
|
if (value instanceof Date)
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return super.convertValueForScript(services, scope, qname, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005 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.service.cmr.workflow;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Workflow Definition Deployment
|
||||||
|
*
|
||||||
|
* @author davidc
|
||||||
|
*/
|
||||||
|
public class WorkflowDeployment
|
||||||
|
{
|
||||||
|
/** Workflow Definition */
|
||||||
|
public WorkflowDefinition definition;
|
||||||
|
|
||||||
|
/** Workflow Status */
|
||||||
|
public String[] problems;
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.lang.Object#toString()
|
||||||
|
*/
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "WorkflowDeployment[def=" + definition + ",problems=" + ((problems == null) ? 0 : problems.length) + "]";
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user