cancel
Showing results for 
Search instead for 
Did you mean: 

commandContext with spring

habib1
Champ in-the-making
Champ in-the-making
Hi,  how to configure activti-context to inject to use commandContext in my services , i try this but it dosen't work :

<blockcode>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
    <property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
   </blockcode>

<blockcode>
<bean id="activitiCommandContext" factory-bean="processEngine" factory-method="getCommandContextFactory" />
</blockcode>
<blockcode>
<bean id="Service" class="com.habib.project.ServiceImpl">
   <property name="commandContext" ref="activitiCommandContext" />
</bean>
</blockcode>
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
You can get the current command context by using Context.getCommandContext() in the code

manoharalfresco
Champ in-the-making
Champ in-the-making
Hai,
   In the same xml i have one problem that is while creating process engine command context is closed then NullPointerException is raised

jbarrez
Star Contributor
Star Contributor
Sorry … I'm not following that question … can you rephrase … and add some example code of what you're trying to do?