cuba-platform / bpm

Business Process Management Addon
https://www.cuba-platform.com/
Apache License 2.0
43 stars 23 forks source link

Unable to create or edit process instances and process definitions #38

Closed natfirst closed 6 years ago

natfirst commented 6 years ago

Environment

Description of the bug or enhancement

  1. Add bpm addon to the project
  2. Open Process Instances screen
  3. Click Create or Edit.

A.R. Exception will appear The same exception appears in the Process Definitions screen when clicking Edit

java.lang.NullPointerException
    at com.haulmont.cuba.web.gui.components.WebPickerField.actionPropertyChanged(WebPickerField.java:295)
    at com.haulmont.bali.events.EventHub.publish(EventHub.java:170)
    at com.haulmont.cuba.gui.components.AbstractAction.firePropertyChange(AbstractAction.java:272)
    at com.haulmont.cuba.gui.components.PickerField$StandardAction.setEditable(PickerField.java:248)
    at com.haulmont.cuba.gui.components.PickerField$StandardAction.editableChanged(PickerField.java:275)
    at com.haulmont.cuba.web.gui.components.WebPickerField.setEditable(WebPickerField.java:433)
    at com.haulmont.cuba.web.gui.components.WebFieldGroup.applyFieldDefaults(WebFieldGroup.java:346)
    at com.haulmont.cuba.web.gui.components.WebFieldGroup.bindDeclarativeFieldConfigs(WebFieldGroup.java:531)
    at com.haulmont.cuba.web.gui.components.WebFieldGroup.bind(WebFieldGroup.java:504)
    at com.haulmont.cuba.gui.xml.layout.loaders.FieldGroupLoader.loadComponent(FieldGroupLoader.java:175)
    at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:38)
    at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:90)
    at com.haulmont.cuba.gui.xml.layout.loaders.AbstractBoxLoader.loadComponent(AbstractBoxLoader.java:52)
    at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:38)
    at com.haulmont.cuba.gui.xml.layout.loaders.ScrollBoxLayoutLoader.loadComponent(ScrollBoxLayoutLoader.java:80)
    at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponents(ContainerLoader.java:38)
    at com.haulmont.cuba.gui.xml.layout.loaders.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:90)
    at com.haulmont.cuba.gui.xml.layout.loaders.WindowLoader.loadComponent(WindowLoader.java:101)
    at com.haulmont.cuba.web.sys.WebScreens.loadScreenXml(WebScreens.java:254)
    at com.haulmont.cuba.web.sys.WebScreens.createScreen(WebScreens.java:201)
    at com.haulmont.cuba.web.sys.WebScreens.create(WebScreens.java:154)
    at com.haulmont.cuba.web.sys.WebScreens.openEditor(WebScreens.java:623)
    at com.haulmont.cuba.gui.screen.compatibility.LegacyFrame.openEditor(LegacyFrame.java:176)
    at com.haulmont.cuba.gui.components.actions.CreateAction.internalOpenEditor(CreateAction.java:297)
    at com.haulmont.cuba.gui.components.actions.CreateAction.actionPerform(CreateAction.java:257)
    at com.haulmont.cuba.web.gui.components.WebButton.buttonClicked(WebButton.java:60)
    at com.haulmont.cuba.web.widgets.CubaButton.fireClick(CubaButton.java:76)
    at com.vaadin.ui.Button$1.click(Button.java:57)

For QA: check the https://app.zenhub.com/workspace/o/cuba-platform/cuba-gradle-plugin/issues/71

jreznot commented 6 years ago

Now IllegalArgumentException is thrown:

IllegalArgumentException: You have attempted to set a value of type class 
com.haulmont.bpm.entity.ProcInstance for parameter procInstance with expected type of class 
java.util.UUID from query string select pt from bpm$ProcTask pt left join pt.procActor pa left join 
pa.user pau where pt.procInstance.id = :procInstance and (pau.id = :userId or (pa is null and 
exists(select pt2 from bpm$ProcTask pt2 join pt2.candidateUsers cu where pt2.id = pt.id and cu.id = 
:userId))) and pt.endDate is null.

Relates to https://github.com/cuba-platform/cuba/issues/744

haulmont-git commented 6 years ago

Git changesets by artamonov:

31ed9915 in master - Unable to create or edit process instances and process definitions #38

natfirst commented 6 years ago

When trying to deploy the process:

IllegalArgumentException: You have attempted to set a value of type class 
com.haulmont.bpm.entity.ProcModel for parameter model with expected type of class java.util.UUID 
from query string select pd from bpm$ProcDefinition pd where pd.model.id = :model order by pd.name, pd.deploymentDate desc.
natfirst commented 6 years ago
  1. Create a process instance
  2. Select process definition
java.lang.IllegalArgumentException: You have attempted to set a value of type class 
com.haulmont.bpm.entity.ProcDefinition for parameter custom_procDefinition with expected type 
of class java.util.UUID from query string 

                select pr from bpm$ProcRole pr where pr.procDefinition.id = :custom_procDefinition order by pr.name

            .
    at org.eclipse.persistence.internal.jpa.QueryImpl.setParameterInternal(QueryImpl.java:944)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(EJBQueryImpl.java:609)
    at com.haulmont.cuba.core.sys.QueryImpl$Param.apply(QueryImpl.java:758)
    at com.haulmont.cuba.core.sys.QueryImpl.getQuery(QueryImpl.java:153)
    at com.haulmont.cuba.core.sys.QueryImpl.getResultList(QueryImpl.java:369)
    at com.haulmont.cuba.core.app.RdbmsStore.executeQuery(RdbmsStore.java:756)
    at com.haulmont.cuba.core.app.RdbmsStore.getResultList(RdbmsStore.java:664)
    at com.haulmont.cuba.core.app.RdbmsStore.loadList(RdbmsStore.java:225)
    at com.haulmont.cuba.core.app.DataManagerBean.loadList(DataManagerBean.java:74)
    at com.haulmont.cuba.core.app.DataServiceBean.loadList(DataServiceBean.java:54)
haulmont-git commented 6 years ago

Git changesets by artamonov:

c901f9ba in master - Unable to create or edit process instances and process definitions #38

natfirst commented 6 years ago
  1. Create a process with the role
  2. Create a process instance, assign the task to the user
  3. Try to cancel process
    java.lang.IllegalArgumentException: You have attempted to set a value of type class com.haulmont.bpm.entity.ProcInstance for parameter procInstance with expected type of class java.util.UUID from query string select a from bpm$ProcTask a where a.procInstance.id = :procInstance and a.endDate is null.
    at org.eclipse.persistence.internal.jpa.QueryImpl.setParameterInternal(QueryImpl.java:944)
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(EJBQueryImpl.java:609)
    at com.haulmont.cuba.core.sys.QueryImpl$Param.apply(QueryImpl.java:758)
    at com.haulmont.cuba.core.sys.QueryImpl.getQuery(QueryImpl.java:153)
    at com.haulmont.cuba.core.sys.QueryImpl.getResultList(QueryImpl.java:369)
    at com.haulmont.bpm.core.ProcessRuntimeManagerBean.cancelProcess(ProcessRuntimeManagerBean.java:128)
    at com.haulmont.bpm.service.ProcessRuntimeServiceBean.cancelProcess(ProcessRuntimeServiceBean.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
    at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:117)
    at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:174)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy269.cancelProcess(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
haulmont-git commented 6 years ago

Git changesets by artamonov:

85453686 in master - Unable to create or edit process instances and process definitions #38

Fix ProcessRuntimeManagerBean cancelProcess