03-20-2013 04:30 PM
function wfGetNode()
{
if( bpm_package.children.length <= 0 )
{
throw "no node attached to workflow";
}
return bpm_package.children[0];
}
public class IssuePost extends BaseJavaDelegate implements ExecutionListener
{
private Logger _logger = Logger.getLogger( IssuePost.class );
@Override
public void notify( DelegateExecution task ) throws Exception
{
try
{
NodeRef workflowPackage = null;
ActivitiScriptNode scriptNode =
( ActivitiScriptNode )(( ExecutionEntity ) task ).getVariable( WorkflowNotificationUtils.PROP_PACKAGE );
if( scriptNode != null )
{
workflowPackage = scriptNode.getNodeRef();
_logger.info( "IssuePost: workflowPackage " + workflowPackage.getId() + " workflow task " + task.getId() + " scriptNode " + scriptNode.getId() + " " + scriptNode.getName());
Scriptable nodeKids = scriptNode.getChildren();
for( int i=0; i < nodeKids.getIds().length; i++ )
{
_logger.info( "IssuePost: nodeKids.getIds()[" + i + "] = " + nodeKids.getIds() );
}
03-21-2013 03:05 AM
03-21-2013 10:25 AM
03-21-2013 04:49 PM
<bean id="IssuePost" class="com.epnet.alfresco.metadata.listener.IssuePost" depends-on="activitiBeanRegistry">
<property name="serviceRegistry" ref="ServiceRegistry" />
</bean>
[factory.support.DefaultListableBeanFactory] Creating shared instance of singleton bean 'IssuePost'
[factory.support.DefaultListableBeanFactory] Creating instance of bean 'IssuePost'
[factory.support.DefaultListableBeanFactory] Eagerly caching bean 'IssuePost' to allow for resolving potential circular references
[factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'ServiceRegistry'
[metadata.listener.IssuePost] IssuePost: In setServiceRegistry(). ServiceRegistry is not null
[factory.support.DefaultListableBeanFactory] Finished creating instance of bean 'IssuePost'
[metadata.listener.IssuePost] IssuePost: Service Registry still null.
<receiveTask id="IssuePost" name="Issue Post">
<extensionElements>
<activiti:executionListener event="start" class="com.epnet.alfresco.metadata.listener.IssuePost"></activiti:executionListener>
</extensionElements>
</receiveTask>
03-21-2013 05:57 PM
<bean id="AbstractWorkflowDelegate" parent="baseJavaDelegate" abstract="true" depends-on="activitiBeanRegistry" />
<bean id="IssuePost" parent="AbstractWorkflowDelegate" class="com.epnet.alfresco.metadata.listener.IssuePost" />
package com.epnet.alfresco.metadata.listener;
public class IssuePost extends BaseJavaDelegate implements ExecutionListener
{
}
<receiveTask id="IssuePost" name="Issue Post">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="${IssuePost}"></activiti:executionListener>
</extensionElements>
</receiveTask>
03-21-2013 09:57 PM
public void notify( DelegateExecution task ) throws Exception
{
try
{
ActivitiScriptNode scriptNode =
( ActivitiScriptNode )(( ExecutionEntity ) task ).getVariable( WorkflowNotificationUtils.PROP_PACKAGE );
if( scriptNode != null )
{
NodeRef workflowPackage = scriptNode.getNodeRef();
NodeRef currentNodeRef = nodeService.getChildAssocs( workflowPackage ).get(0).getChildRef();
logger.info( "IssuePost: currentNodeRef " + currentNodeRef.getId() );
???
03-28-2013 09:29 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.