Hi all,
So i am having this error so i have added bpmn file in the resources/process/.bpmn file
and to start this processInstance i wrote the backend code for it this way
ProcessInstance processInstance=runtimeService.startProcessInstanceById(“startprocess”,variables); but i keeo getting the error
no deployed process definition found with id ‘startprocess’ if you could help me with this
@Service
public class CommonService { @Autowired
private RuntimeService runtimeService; @Autowired
private TaskService taskService;
public void startprocess(){
ProcessInstance processInstance=runtimeService.startProcessInstanceById("workflow");
System.out.println("The process Instance Id "+processInstance.getProcessInstanceId());
}
}
org.flowable.common.engine.api.FlowableObjectNotFoundException: no deployed process definition found with id ‘workflow’
org.flowable.common.engine.api.FlowableObjectNotFoundException: no deployed process definition found with id ‘workflow’
at org.flowable.engine.impl.persistence.deploy.DeploymentManager.findDeployedProcessDefinitionById(DeploymentManager.java:78) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.getProcessDefinition(StartProcessInstanceCmd.java:274) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:128) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:53) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:72) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:176) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:121) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:77) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26) ~[flowable-engine-7.0.1.jar:7.0.1]
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53) ~[flowable-engine-common-7.0.1.jar:7.0.1]
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105) ~[flowable-engine-common-7.0.1.jar:7.0.1]
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57) ~[flowable-spring-common-7.0.1.jar:7.0.1]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-6.1.11.jar:6.1.11]
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57) ~[flowable-spring-common-7.0.1.jar:7.0.1]
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) ~[flowable-engine-common-7.0.1.jar:7.0.1]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) ~[flowable-engine-common-7.0.1.jar:7.0.1]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51) ~[flowable-engine-common-7.0.1.jar:7.0.1]
at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:171) ~[flowable-engine-7.0.1.jar:7.0.1]
at com.example.workflow.common_workflow.CommonService.startprocess(CommonService.java:27) ~[classes/:na]
at com.example.workflow.common_workflow.CommonController.startprocess(CommonController.java:20) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.1.11.jar:6.1.11]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) ~[spring-webmvc-6.1.11.jar:6.1.11]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.11.jar:6.1.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.11.jar:6.1.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.springframework.web.filter.ServerHttpObservationFilter.doFilterInternal(ServerHttpObservationFilter.java:113) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.11.jar:6.1.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.1.11.jar:6.1.11]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.1.11.jar:6.1.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:904) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) ~[tomcat-embed-core-10.1.26.jar:10.1.26]
at java.base/java.lang.Thread.run(Thread.java:842) ~[na:na]
2024-08-22T18:07:37.740+05:30 INFO 26224 — [common-workflow] [ main] c.e.w.c.CommonWorkflowApplication : Starting CommonWorkflowApplication using Java 17.0.11 with PID 26224 (C:\Users\617361303\Downloads\common-workflow\common-workflow\target\classes started by 617361303 in C:\Users\617361303\Downloads\common-workflow\common-workflow)
2024-08-22T18:07:37.740+05:30 INFO 26224 — [common-workflow] [ main] c.e.w.c.CommonWorkflowApplication : No active profile set, falling back to 1 default profile: “default”
2024-08-22T18:07:40.858+05:30 INFO 26224 — [common-workflow] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8090 (http)
2024-08-22T18:07:40.874+05:30 INFO 26224 — [common-workflow] [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-08-22T18:07:40.874+05:30 INFO 26224 — [common-workflow] [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.26]
2024-08-22T18:07:41.022+05:30 INFO 26224 — [common-workflow] [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-08-22T18:07:41.036+05:30 INFO 26224 — [common-workflow] [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3208 ms
2024-08-22T18:07:41.508+05:30 INFO 26224 — [common-workflow] [ main] o.f.s.b.app.AppEngineAutoConfiguration : No deployment resources were found for autodeployment
2024-08-22T18:07:41.744+05:30 WARN 26224 — [common-workflow] [ main] .s.w.r.s.c.ProcessIdGeneratorInitializer : process.instanceId.generator property is missing application.properties
2024-08-22T18:07:42.004+05:30 INFO 26224 — [common-workflow] [ main] .b.s.w.r.s.c.WorkflowEngineConfiguration : Process engine configuration is initialized.
2024-08-22T18:07:42.043+05:30 INFO 26224 — [common-workflow] [ main] o.f.s.b.c.CmmnEngineAutoConfiguration : No deployment resources were found for autodeployment
2024-08-22T18:07:42.119+05:30 INFO 26224 — [common-workflow] [ main] o.f.s.b.dmn.DmnEngineAutoConfiguration : No deployment resources were found for autodeployment
2024-08-22T18:07:42.154+05:30 INFO 26224 — [common-workflow] [ main] o.f.s.b.e.EventRegistryAutoConfiguration : No deployment resources were found for autodeployment
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Found 5 Engine Configurators in total:
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : class org.flowable.engine.spring.configurator.SpringProcessEngineConfigurator (priority:50000)
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : class org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator (priority:150000)
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : class org.flowable.dmn.spring.configurator.SpringDmnEngineConfigurator (priority:200000)
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
2024-08-22T18:07:42.203+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing beforeInit() of class org.flowable.engine.spring.configurator.SpringProcessEngineConfigurator (priority:50000)
2024-08-22T18:07:42.254+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing beforeInit() of class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2024-08-22T18:07:42.254+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing beforeInit() of class org.flowable.idm.spring.configurator.SpringIdmEngineConfigurator (priority:150000)
2024-08-22T18:07:42.254+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing beforeInit() of class org.flowable.dmn.spring.configurator.SpringDmnEngineConfigurator (priority:200000)
2024-08-22T18:07:42.270+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing beforeInit() of class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
2024-08-22T18:07:42.353+05:30 INFO 26224 — [common-workflow] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting…
2024-08-22T18:07:42.620+05:30 INFO 26224 — [common-workflow] [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@507f7cd1
2024-08-22T18:07:42.620+05:30 INFO 26224 — [common-workflow] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2024-08-22T18:07:43.913+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing configure() of class org.flowable.engine.spring.configurator.SpringProcessEngineConfigurator (priority:50000)
2024-08-22T18:07:44.087+05:30 INFO 26224 — [common-workflow] [ main] o.f.engine.impl.ProcessEngineImpl : ProcessEngine default created
2024-08-22T18:07:44.120+05:30 INFO 26224 — [common-workflow] [ main] o.f.e.impl.cmd.ValidateV5EntitiesCmd : Total of v5 deployments found: 0
2024-08-22T18:07:44.120+05:30 INFO 26224 — [common-workflow] [ main] o.f.a.s.SpringAppEngineConfiguration : Executing configure() of class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2024-08-22T18:07:44.319+05:30 INFO 26224 — [common-workflow] [ main] liquibase.database : Set default schema name to public
2024-08-22T18:07:44.771+05:30 INFO 26224 — [common-workflow] [ main] liquibase.changelog : Reading from public.flw_ev_databasechangelog
Database is up to date, no changesets to execute
2024-08-22T18:07:44.837+05:30 INFO 26224 — [common-workflow] [ main] liquibase.changelog : Reading from public.flw_ev_databasechangelog
As you can see in the DB it does get deployed. Why you are seeing the errors I cannot explain. Can you please create an example project that we can run and try it out. With what you have shared so far we cannot say why it isn’t working for you.
@Service
public class FlowableService { @Autowired
private RuntimeService runtimeService; @Autowired
private TaskService taskService;
public void startprocess(){
ProcessInstanceinstance=runtimeService.startProcessInstanceById("startProcess");
System.out.println("The process Instance Id "+instance.getProcessInstanceId());
}
}
@RestController @RequestMapping(“/workflow”)
public class Controller { @Autowired
private FlowableService service;
@PostMapping("/start")
public void startProcess(){
service.startprocess();
}
@kartik please create a github repository with the code and with steps that we need to run to be able to get the error. Just sharing code here is not enough.
Hey, ProcessInstance processInstance=runtimeService.startProcessInstanceById(“startprocess”,variables);
is not meant to be called like that.
Starts a new process instance in the exactly specified version of the process definition with the given id.
*
* @param processDefinitionId
* the id of the process definition, cannot be null.
* @throws FlowableObjectNotFoundException
* when no process definition is deployed with the given key.
*/
ProcessInstance startProcessInstanceById(String processDefinitionId);
The processDefinitionId is the unique ID created during deployment. If you deploy a new version of the same process, you will get a new processDefinitionId.
What you want to use is the