cancel
Showing results for 
Search instead for 
Did you mean: 

Calling spring bean from alfresco activiti process

younis15
Champ in-the-making
Champ in-the-making
Within alfresco activiti, could I call a spring bean using the servicetask like :

<serviceTask id="assignApplicationId" name="Assign Application Id"
  activiti:expression="${sequenceUtil.getOutboundId(task.id)}"
  activiti:resultVariable="OutboundWF_ApplicationNumber"/>
however, in my custom context I declared the
sequenceUtil
as the following:
<bean id="sequenceUtil" name="sequenceUtil" class="com.tts.mersal.presentation.bean.dialog.util.SequenceUtil">
    <property name="searchService">
        <ref bean="searchService" />
    </property>
    <property name="nodeService">
        <ref bean="nodeService" />
    </property>
    <property name="workflowService">
        <ref bean="WorkflowService" />
    </property>    
</bean>
Actually I got the following exception
org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'sequenceUtil'
at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)
at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:46)
2 REPLIES 2

younis15
Champ in-the-making
Champ in-the-making
I got it Smiley Happy

I have to override the  activitiProcessEngineConfiguration bean to include my custom bean within beans property


<!– –>
<!– Activiti Process Engine –>
<!– –>
<bean id="activitiProcessEngineConfiguration"
    class="org.alfresco.repo.workflow.activiti.AlfrescoProcessEngineConfiguration">
    <property name="dataSource" ref="wrappedDataSource" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="databaseSchemaUpdate" value="${db.schema.update}" />
    <property name="history" value="full" />
    <property name="jobExecutorActivate" value="true" />

<!– Limit the visible beans in expressions –>


<property name="beans">
    <map>
        <entry key="services" value-ref="ServiceRegistry" />
        <entry key="sequenceUtil" value-ref="sequenceUtil" />
    </map>   
</property>

    <property name="customTypes">
        <list>
            <ref bean="activitiScriptNodeType" />
            <ref bean="activitiScriptNodeListType" />
        </list>
    </property>
    <property name="customPreBPMNParseListeners">
        <list>
            <ref bean="activitiParseListener" />
        </list>
    </property>
</bean>

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hello,

Have the same problem. Following Nick Smith's slides, it should be enough extending the BaseJavaDelegate, but it's not…. still facing the same issue. Hope the Alfresco 4 release (not the beta one) solves this problem….

http://www.alfresco.com/resources/devcon2011/sandiego/BPM-3_AdvancedWorkflowDeeperDive_Smith.pdf