cancel
Showing results for 
Search instead for 
Did you mean: 

Multiplicity Violation Error

aniketvast
Champ in-the-making
Champ in-the-making
Hello

I hate giving the entire stackTrace in Topics, however for this one, I had to. Heres what I have done
1> Defined a Custom Workflow model and Process Definition.
2> This works fine from the web client.
3> Now I want to start the workflow based on a rule, so I wrote a tiny JS as recommended in the wiki.

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$ccswfcredential:credential";
workflow.parameters["bpm:assignee"] = person;
workflow.execute(document);

4>Although I get the following error when I hit ok (which is supposed to start the workflow)

20:39:27,330 ERROR [node.integrity.IntegrityChecker] Found 1 integrity violation
s:
The association target multiplicity has been violated:
   Source Node: workspace://SpacesStore/e9c38be3-5fdd-11dc-a68f-611499508bfe
   Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/
bpm/1.0}workflowTask], name={http://www.alfresco.org/model/bpm/1.0}package, targ
et class={http://www.alfresco.org/model/bpm/1.0}workflowPackage, source role=nul
l, target role=null]
   Required target Multiplicity: 1..1
   Actual target Multiplicity: 0
20:39:27,529 ERROR [ui.common.Utils] A system error happened during the operatio
n: Unknown Exception in Transaction.
org.alfresco.error.AlfrescoRuntimeException: Unknown Exception in Transaction.
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:292)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:155)
        at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.jav
a:124)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java
:132)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
nListenerImpl.java:61)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:9
7)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
71)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(Invoke
ApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl
.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(Authentica
tionFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.RollbackException: Transaction didn't commit: Integ
rity failure
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(Sprin
gAwareUserTransaction.java:430)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransacti
on(RetryingTransactionHelper.java:239)
        … 32 more
Caused by: org.alfresco.repo.node.integrity.IntegrityException: Integrity failur
e
        at org.alfresco.repo.node.integrity.IntegrityChecker.checkIntegrity(Inte
grityChecker.java:626)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionS
ynchronizationImpl.flush(AlfrescoTransactionSupport.java:559)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionS
ynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:630)
        at org.springframework.transaction.support.TransactionSynchronizationUti
ls.triggerBeforeCommit(TransactionSynchronizationUtils.java:48)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:821)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.processCommit(AbstractPlatformTransactionManager.java:637)
        at org.springframework.transaction.support.AbstractPlatformTransactionMa
nager.commit(AbstractPlatformTransactionManager.java:624)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.
commitTransactionAfterReturning(TransactionAspectSupport.java:307)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(Sprin
gAwareUserTransaction.java:420)
2 REPLIES 2

aniketvast
Champ in-the-making
Champ in-the-making
I downloaded the latest Alfresco Source Code 1046 and created this java script.
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:review";
workflow.parameters["bpm:assignee"] = person;
workflow.execute(document);

As you can see, I am calling the built-in review workflow. It still gives me the same error above.


Any help is appreciated.

Thanks.

davidc
Star Contributor
Star Contributor
This is an unusual error as workflow tasks are not actually stored as nodes in the repository, but as native jbpm tasks in the jbpm database schema, therefore, are not checked by the integrity checker.

So, one cause is that an actual workflowTask node is getting created somewhere.  However, I can't imagine how.

Have you created other custom rules, actions etc which might be applied?  Are you creating a workflowTask node anywhere?