CMDBuild Forum

Why the calling of the custom function is failed

Hi,

I created a function below, the calling from task script is failed. I checked the log, it is weired that it called the function name as a column from “_copytasksfromtemplatetojob2p”.

Can you give some suggestion for that?

I appreciate it.

Best Regards

-- FUNCTION: public.copy_tasks_from_template_to_job(bigint, bigint, bigint)

-- DROP FUNCTION IF EXISTS public.copy_tasks_from_template_to_job(bigint, bigint, bigint);

CREATE OR REPLACE FUNCTION public.copy_tasks_from_template_to_job(
	job_id bigint,
	job_type_id bigint,
	product_type bigint DEFAULT NULL::bigint)
    RETURNS integer
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE PARALLEL UNSAFE
AS $BODY$
DECLARE
    new_task_id BIGINT;
    task_template_records RECORD;
BEGIN
    -- Assuming there's logic here to validate the job_id and job_type_id

    FOR task_template_records IN
        SELECT * FROM get_tasktemplates_by_producttype(job_type_id, product_type)
    LOOP
        -- Insert into Task and get the new Task ID
        INSERT INTO public."Task"("Code", "Description", "Status", "User", "BeginDate", "Notes", "IdClass")
        VALUES (task_template_records.TaskTemplateCode, task_template_records.TaskTemplateDescription, 'A', 'admin', NOW(), '', '"Task"'::regclass)
        RETURNING "Id" INTO new_task_id;

        -- Now use new_task_id for IdObj2 in Map_Job_Tasks
        INSERT INTO public."Map_Job_Tasks"("IdClass1", "IdObj1", "IdClass2", "IdObj2", "Status", "User", "BeginDate")
        VALUES ('"Job"'::regclass, job_id, '"Task"'::regclass, new_task_id, 'A', 'admin', NOW());
    END LOOP;
	return 1;
END;
$BODY$;

ALTER FUNCTION public.copy_tasks_from_template_to_job(bigint, bigint, bigint)
    OWNER TO cmdbuild_dev;

COMMENT ON FUNCTION public.copy_tasks_from_template_to_job(bigint, bigint, bigint)
    IS 'TYPE: function';

Here is detail error in the log.

2024-02-20T19:34:17.713Z [req:124f54] WARN  o.c.w.inner.WorkflowServiceImpl - received form data Notes =  (String) not defined in flow plan global variables; skipping conversion
2024-02-20T19:34:17.713Z [req:124f54] WARN  o.c.w.inner.WorkflowServiceImpl - received form data Province = LookupValue{id=11324} (org.cmdbuild.dao.beans.LookupValueImpl) not defined in flow plan global variables; skipping conversion
2024-02-20T19:34:17.976Z [req:124f54] WARN  o.c.u.s.b.BeanshellScriptExecutor - error executing beanshell script = 

   1: JobNumber = Province.getCode() + cmdb.callFunction("cmwf_getRFCNumber").execute().get("RFCNumber");
   2: JobTypeCode = JobType.getCode();
   3: cdNewJob = cmdb.newCard("Job")
   4:             .withDescription(JobDescription)
   5:             .withAttribute("JobType", JobTypeCode)
   6:             .create();
   7: 
   8: 
   9: 
  10: spResult = cmdb.callFunction("copy_tasks_from_template_to_job")
  11: 	.with("job_id", cdNewJob.getId())
  12: 	.with("job_type_id", JobType.getId())
  13: 	.with("product_type", null)
  14: 	.execute();
  15: 
  16: rest =spResult.get()

2024-02-20T19:34:17.976Z [req:124f54] WARN  o.c.u.s.b.BeanshellScriptExecutor - error executing beanshell script at line 14: Sourced file: inline evaluation of: ``JobNumber = Province.getCode() + cmdb.callFunction("cmwf_getRFCNumber").execute( . . . '' : Method Invocation execute .execute ( )  

   1: JobNumber = Province.getCode() + cmdb.callFunction("cmwf_getRFCNumber").execute().get("RFCNumber");
   2: JobTypeCode = JobType.getCode();
   3: cdNewJob = cmdb.newCard("Job")
   4:             .withDescription(JobDescription)
   5:             .withAttribute("JobType", JobTypeCode)
   6:             .create();
   7: 
   8: 
   9: 
  10: spResult = cmdb.callFunction("copy_tasks_from_template_to_job")
  11: 	.with("job_id", cdNewJob.getId())
  12: 	.with("job_type_id", JobType.getId())
  13: 	.with("product_type", null)
  14: 	.execute();
  15: 
  16: rest =spResult.get()

2024-02-20T19:34:17.984Z [req:124f54] ERROR o.c.s.r.v.p.ExceptionHandlerService - ws processing error
org.cmdbuild.utils.ws3.utils.Ws3Exception: error processing request =< ws3rest:post:processes/ProjectTask/instances >
	at org.cmdbuild.utils.ws3.servlet.Ws3RestRequestHandlerServlet.handleRequest(Ws3RestRequestHandlerServlet.java:31) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	at org.cmdbuild.utils.ws3.servlet.Ws3AbstractHandlerServlet.service(Ws3AbstractHandlerServlet.java:99) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) ~[servlet-api.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.cmdbuild.webapp.filters.AsyncJobFilter.doFilterInternal(AsyncJobFilter.java:49) ~[classes/:3.4.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.18.jar:5.3.18]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.cmdbuild.webapp.security.SessionTokenFilter.doFilterInternal(SessionTokenFilter.java:177) ~[classes/:3.4.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.5.2.jar:5.5.2]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.18.jar:5.3.18]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.cmdbuild.webapp.filters.LanguageFilter.doFilterInternal(LanguageFilter.java:54) ~[classes/:3.4.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.18.jar:5.3.18]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.cmdbuild.webapp.filters.RequestTrackingFilter.doFilterInternal(RequestTrackingFilter.java:190) ~[classes/:3.4.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.18.jar:5.3.18]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.cmdbuild.webapp.filters.BootCheckFilter.doFilterAfterBootCheck(BootCheckFilter.java:111) ~[classes/:3.4.2]
	at org.cmdbuild.webapp.filters.BootCheckFilter.doFilterInternal(BootCheckFilter.java:70) ~[classes/:3.4.2]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.18.jar:5.3.18]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.18.jar:5.3.18]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[catalina.jar:9.0.71]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[catalina.jar:9.0.71]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[catalina.jar:9.0.71]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) ~[catalina.jar:9.0.71]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[catalina.jar:9.0.71]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) ~[catalina.jar:9.0.71]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) ~[tomcat-coyote.jar:9.0.71]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-coyote.jar:9.0.71]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) ~[tomcat-coyote.jar:9.0.71]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784) ~[tomcat-coyote.jar:9.0.71]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:9.0.71]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-util.jar:9.0.71]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-util.jar:9.0.71]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:9.0.71]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: org.cmdbuild.utils.ws3.utils.Ws3Exception: error processing request with handler = Ws3RequestMethodHanlder{service=org.cmdbuild.service.rest.v3.endpoint.ProcessInstancesWs, method=create}
	at org.cmdbuild.utils.ws3.inner.Ws3RequestHandlerImpl.handleRequest(Ws3RequestHandlerImpl.java:83) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	at org.cmdbuild.utils.ws3.servlet.Ws3RestRequestHandlerServlet.handleRequest(Ws3RestRequestHandlerServlet.java:29) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	... 87 common frames omitted
Caused by: org.cmdbuild.utils.ws3.utils.Ws3Exception: error processing ws3 request = Ws3RestRequest{uri=ws3rest:post:processes/ProjectTask/instances}
	at org.cmdbuild.utils.ws3.inner.Ws3RequestMethodHandler.handleRequest(Ws3RequestMethodHandler.java:86) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	at org.cmdbuild.utils.ws3.inner.Ws3RequestHandlerImpl.handleRequest(Ws3RequestHandlerImpl.java:81) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	... 88 common frames omitted
Caused by: org.cmdbuild.workflow.model.WorkflowException: error advancing process = Flow{id=15152, process=ProjectTask, tasklist=StartProject[j9jia7b14kxqmpux27moos70]@ChangeManager, status=OPEN} for task = TaskDefinitionImpl{id=StartProject, description=Start Project}
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl$ProcessOperation.advanceProcess(WorkflowServiceImpl.java:930) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl$StartProcessOperation.startProcess(WorkflowServiceImpl.java:708) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl.startProcess(WorkflowServiceImpl.java:525) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl.startProcess(WorkflowServiceImpl.java:308) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.WorkflowService.startProcess(WorkflowService.java:134) ~[cmdbuild-workflow-commons-3.4.2.jar:3.4.2]
	at org.cmdbuild.service.rest.v3.endpoint.ProcessInstancesWs.create(ProcessInstancesWs.java:98) ~[cmdbuild-services-rest-v3-3.4.2.jar:3.4.2]
	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.cmdbuild.utils.ws3.inner.Ws3RequestMethodHandler.handleRequest(Ws3RequestMethodHandler.java:82) ~[cmdbuild-utils-ws3-3.4.2.jar:3.4.2]
	... 89 common frames omitted
Caused by: org.cmdbuild.workflow.river.engine.task.scriptexecutors.WorkflowScriptProcessingException: error running workflow script for task = Create_Job_Acitivity within flow = 0sn8mchpye4zefkd5d5jfsd8, plan = vy5c7fjdfteem3dteemg8tx5 (ProjectProcess)
	at org.cmdbuild.workflow.river.engine.task.scriptexecutors.TaskScriptExecutorServiceImpl$TaskScriptExecutor.executeTask(TaskScriptExecutorServiceImpl.java:140) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.task.scriptexecutors.TaskScriptExecutorServiceImpl.executeTask(TaskScriptExecutorServiceImpl.java:58) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.task.RiverTaskServiceImpl.executeTask(RiverTaskServiceImpl.java:54) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.run.FlowExecutorImpl$FlowAdvanceOperation.enterStep(FlowExecutorImpl.java:117) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.run.FlowExecutorImpl$FlowAdvanceOperation.processAndReturnFlow(FlowExecutorImpl.java:93) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.run.FlowExecutorImpl.completedTask(FlowExecutorImpl.java:55) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.core.RiverFlowServiceImpl.completedTask(RiverFlowServiceImpl.java:71) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.CmRiverFlowServiceImpl.completedTask(CmRiverFlowServiceImpl.java:32) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl$ProcessOperation.addCurrentPerformerDataInFlowAndCompleteTask(WorkflowServiceImpl.java:859) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl$ProcessOperation.doAdvanceProcess(WorkflowServiceImpl.java:938) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.inner.WorkflowServiceImpl$ProcessOperation.advanceProcess(WorkflowServiceImpl.java:928) ~[cmdbuild-workflow-core-3.4.2.jar:3.4.2]
	... 99 common frames omitted
Caused by: org.cmdbuild.utils.lang.CmException: beanshell script error =< .execute ( )  > at line = 14
	at org.cmdbuild.utils.script.beanshell.BeanshellScriptExecutor.execute(BeanshellScriptExecutor.java:83) ~[cmdbuild-utils-script-3.4.2.jar:3.4.2]
	at org.cmdbuild.workflow.river.engine.task.scriptexecutors.TaskScriptExecutorServiceImpl$TaskScriptExecutor.executeTask(TaskScriptExecutorServiceImpl.java:116) ~[cmdbuild-workflow-river-3.4.2.jar:3.4.2]
	... 109 common frames omitted
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [SELECT copy_tasks_from_template_to_job AS _copytasksfromtemplatetojob2p FROM copy_tasks_from_template_to_job(15156, 11589) _copytasksfromtemplatetojob]; nested exception is org.postgresql.util.PSQLException: ERROR: column "copy_tasks_from_template_to_job" does not exist
  Position: 8
	at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:465) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:475) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.cmdbuild.dao.postgres.services.StoredFunctionServiceImpl$FunctionPreparedQuery.run(StoredFunctionServiceImpl.java:189) ~[cmdbuild-dao-postgresql-3.4.2.jar:3.4.2]
	at org.cmdbuild.dao.postgres.services.StoredFunctionServiceImpl.callFunction(StoredFunctionServiceImpl.java:107) ~[cmdbuild-dao-postgresql-3.4.2.jar:3.4.2]
	at org.cmdbuild.api.inner.LocalFluentApiExecutorImpl.execute(LocalFluentApiExecutorImpl.java:255) ~[cmdbuild-api-core-3.4.2.jar:3.4.2]
	at org.cmdbuild.api.fluent.FunctionCallImpl.execute(FunctionCallImpl.java:38) ~[cmdbuild-api-model-3.4.2.jar:3.4.2]
	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 bsh.Reflect.invokeMethod(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.Reflect.invokeObjectMethod(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.BSHPrimarySuffix.doName(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.BSHPrimarySuffix.doSuffix(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.BSHPrimaryExpression.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.BSHPrimaryExpression.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.BSHAssignment.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.Interpreter.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.Interpreter.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at bsh.Interpreter.eval(Unknown Source) ~[bsh-2.0b4.jar:2.0b4 2005-05-23 11:49:20]
	at org.cmdbuild.utils.script.beanshell.BeanshellScriptExecutor.execute(BeanshellScriptExecutor.java:56) ~[cmdbuild-utils-script-3.4.2.jar:3.4.2]
	... 110 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: column "copy_tasks_from_template_to_job" does not exist
  Position: 8
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291) ~[postgresql-42.4.1.jar:42.4.1]
	at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:243) ~[postgresql-42.4.1.jar:42.4.1]
	at org.apache.commons.dbcp2.DelegatingStatement.executeQuery(DelegatingStatement.java:206) ~[commons-dbcp2-2.3.0.jar:2.3.0]
	at org.apache.commons.dbcp2.DelegatingStatement.executeQuery(DelegatingStatement.java:206) ~[commons-dbcp2-2.3.0.jar:2.3.0]
	at com.p6spy.engine.wrapper.StatementWrapper.executeQuery(StatementWrapper.java:81) ~[p6spy-3.7.0.jar:na]
	at org.apache.commons.dbcp2.DelegatingStatement.executeQuery(DelegatingStatement.java:206) ~[commons-dbcp2-2.3.0.jar:2.3.0]
	at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452) ~[spring-jdbc-5.3.18.jar:5.3.18]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381) ~[spring-jdbc-5.3.18.jar:5.3.18]
	... 131 common frames omitted
2024-02-20T19:34:17.985Z [req:124f54] WARN  o.c.w.f.RequestTrackingFilter$$EnhancerBySpringCGLIB$$965932d - processed request, returned error for requestId = 124f54cef39a4167s30zmcfm