cancel
Showing results for 
Search instead for 
Did you mean: 

after bpmn deployment, activiti still uses previous deployment file

puvanenthiran
Champ in-the-making
Champ in-the-making
I have a activiti process initializer code as below. The bpmn file will be deployed every time when ever I restart my server. I have configured the DB to Oracle DB. If I change the method signature in the bpmn file and java bean, sporadically it is not picking new bpmn file and throws "Unknown method used in expression" exception. Can you please help us to fix this issue.

private static void init() {
   logger.info("Initialization started");
   ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
   repositoryService = processEngine.getRepositoryService();
   repositoryService.createDeployment()
      .addClasspathResource("diagrams/Workflow1.bpmn").deploy();
   repositoryService.createDeployment()
      .addClasspathResource("diagrams/ChildWorkflow.bpmn").deploy();
   repositoryService.createDeployment()
      .addClasspathResource("diagrams/InflightWorkflow.bpmn").deploy();
   runtimeService = processEngine.getRuntimeService();
   logger.info("Initialization ended");
}


Exception:
org.activiti.engine.ActivitiException: Unknown method used in expression: ${!preQualResponseProcessor.hasErrors()}
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:55) ~[activiti-engine-5.14.jar:5.14]
9 REPLIES 9

puvanenthiran
Champ in-the-making
Champ in-the-making
let me reframe the question again.

- Let say, today I deploy the bpmn file.
- One of the serviceTask has activiti:expression as below
          "activiti:expression="#{preQualResponseProcessor.execute()}"
- I started the process. After few task execution, the process stops at one of the ReceiveTask

- Now, I modify the bpmn file, let say, I have added new parameters in the activiti:expression as below
              Modified to - "activiti:expression="#{preQualResponseProcessor.execute(execution)}"
- I redeploy the bpmn file
- Now, If I signal ReceiveTask which is waiting previously. It throws "Unknown method used in expression".

It is because, activiti is still looking for preQualResponseProcessor.execute() method. Even though, I have modified the bpmn and redeployed the new bpmn file.

Please help us to fix the issue. I am expecting new bpmn file should be effective. Even though, the process started in the previous version bpmn file.

puvanenthiran
Champ in-the-making
Champ in-the-making
If  I update ACT_GE_BYTEARRAY table's bytes_ column with latest bpmn file, then the process which are waiting at ReceiveTask, picks latest bpmn changes. It works fine.

Query
——
update ACT_GE_BYTEARRAY set bytes_=(select bytes_ from ACT_GE_BYTEARRAY where deployment_id_ in ('148701'))  where deployment_id_ ='137501';

Is it right way to update the process which are started with older version bpmn file, to use new bpmn file?. Please provide your valuable feedback.

jbarrez
Star Contributor
Star Contributor
> lease help us to fix the issue. I am expecting new bpmn file should be effective. Even though, the process started in the previous version
> bpmn file.

No: old processes will continue to be executed against the version they are started with.

There is an (experimental) SetProcessDefinitionId command you can use to move the version programmatically.

steper
Champ in-the-making
Champ in-the-making
Thank you, could you show an example of how to use SetProcessDefinitionId?
There is a need update startet process instance.
Is there a right way than:
1) cancel the process instance of the old process version
2) start a new instance of the extended process and forward it programmatically to the desired state
?

leggebroten
Champ in-the-making
Champ in-the-making
STepeR,
Attached is an example of the SetProcessDefinitionVersionCmd that we used.
Things to note:
1) it's a junit test (it's been a long time since we've used it)
2) Upgrading instances in this manner may not produce the results you expect - please read their comments.  I can elaborate more if you need.

In the long run you'll probably need model-specific upgrade scripts that can account for new states, conditions, and messages/signals.

-Lee

jbarrez
Star Contributor
Star Contributor
Thanks Lee, for sharing this. I believe it is helpful for many people!

mauwarrior
Champ in-the-making
Champ in-the-making
I have the same problem with my deployment. Lets say I deployed my first .bpmn file and it goes well, but I need to redeploy another .bpmn file because of an update. I used the same filename for my bpmn since I only added a user task from the previous file. I deployed the second bpmn file (which is the updated one), it was successfully deployed. Unfortunately, I cannot start the whole process since activiti Abstract query returns multiple instances.

Here is the stacktrace:

2016/04/15 15:02:35 org.apache.catalina.core.StandardWrapperValve invoke
致命的: サーブレット webapp のServlet.service()が例外を投げました
org.activiti.engine.ActivitiException: Query return 2 results instead of max 1
at org.activiti.engine.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:162)
at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:141)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
at org.activiti.engine.impl.AbstractQuery.singleResult(AbstractQuery.java:104)
at ace.awsol.ssc.web.controller.core.ProcessController.startProcess(ProcessController.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662).

Now my question is: Is there a way to update the previous process or delete the previous deployment so that when I deployed my new bpmn there will be no errors? Please help..I've been searching the web for several weeks already only to find answers on deleting previous deployment…

Let me rephrase my question:
Suppose I deploy a bpmn file (RequestToPurchase.bpmn20.xml). Then,
I deploy again the bpmn file (RequestToPurchase.bpmn20.xml) but with the additional updates.
Both bpmn file will be deployed even if the same name but I was expecting the first deployment will be updated.
No problem with deployment but starting the process there is. If I start the process, an error will occur and the stack trace above is the sample. Please help so I can update my previously deployed bpmn file with my updated bpmn.

jbarrez
Star Contributor
Star Contributor
"If I start the process, an error will occur and the stack trace above is the sample."

The stacktrace above is about a query result, if I'm not mistaken. You need to add latestVersion() to the query to make it work.

"Both bpmn file will be deployed even if the same name but I was expecting the first deployment will be updated."

No, Activiti (and many other BPM systems) do not change process definitions which have process instances that are in flight. That would break many people's currently running instances.