Error On Completing The Document

884 views
Skip to first unread message

Mohemmed Bilal Ilyas

unread,
Oct 3, 2014, 9:07:54 AM10/3/14
to idem...@googlegroups.com

I have attached the workflow behind the complete button process .My window name is leave request . A user can request for a leave and admin can approve it .For Achieving such functionality I have made my workflow like this .

Start>>>>Approve>>>Complete
\/
\/
Auto

when I complete the document it shows me status terminated and the error which comes in console is something like this

-----------> MWorkflow.getNodesInOrder: Added Node w/o transition: MWFNode[10000
03-(DocComplete),Action=DocumentAction=CO]
 [17]
-----------> MWFActivity.run: MWFNode[1000002-(DocAuto),Action=DocumentAction=--
]
 [17]
java.lang.IllegalStateException: Persistent Object not DocAction - org.adempiere
.model.GenericPO - AD_Table_ID=1000000, Record_ID=1000001
at org.compiere.wf.MWFActivity.performWork(MWFActivity.java:913)
at org.compiere.wf.MWFActivity.run(MWFActivity.java:785)
at org.compiere.wf.MWFProcess.startNext(MWFProcess.java:370)
at org.compiere.wf.MWFProcess.checkActivities(MWFProcess.java:280)
at org.compiere.wf.MWFActivity.setWFState(MWFActivity.java:274)
at org.compiere.wf.MWFActivity.run(MWFActivity.java:802)
at org.compiere.wf.MWFProcess.startWork(MWFProcess.java:502)
at org.compiere.wf.MWorkflow.start(MWorkflow.java:696)
at org.compiere.wf.MWorkflow.startWait(MWorkflow.java:726)
at org.adempiere.util.ProcessUtil.startWorkFlow(ProcessUtil.java:301)
at org.compiere.apps.ProcessCtl.startWorkflow(ProcessCtl.java:574)
at org.compiere.apps.ProcessCtl.run(ProcessCtl.java:369)

Carlos Antonio Ruiz Gomez

unread,
Oct 3, 2014, 9:31:19 AM10/3/14
to idem...@googlegroups.com
Hi, is this error on iDempiere or Adempiere?
http://sourceforge.net/p/adempiere/discussion/610548/thread/0b405669/

If is iDempiere, please try to reproduce it in http://demo.idempiere.com/webui

Regards,

Carlos Ruiz
--

redhuan d. oon

unread,
Oct 4, 2014, 4:40:42 AM10/4/14
to idem...@googlegroups.com
The error stack seems to say the Transition is not defined. Can you check that? I worked on Workflow some time ago and you can read up for open source insight: http://red1.org/adempiere/viewtopic.php?f=45&t=1801

Jan Thielemann

unread,
Oct 5, 2014, 3:51:44 AM10/5/14
to idem...@googlegroups.com
Are you using a custom window? For me it seems that your PO is not found and the GenericPO is taken instead. If you have a workflow on your custom table you maybe should  provide a PO for your table which implements the DocAction interface.

Mohemmed Bilal Ilyas

unread,
Oct 5, 2014, 6:04:21 AM10/5/14
to idem...@googlegroups.com
yes jan i am using custom window but I am not understanding your PO point

Jan Thielemann

unread,
Oct 5, 2014, 8:38:05 AM10/5/14
to idem...@googlegroups.com
Have you read through http://wiki.idempiere.org/en/Developing_Plug-Ins_-_Models,_Documents_and_custom_accounting ?

If you have a custom table, the application has no custom persistent object (PO, a object which has information about getters, setters and custom business logic) for your table. It uses a default po in this case, which is called GenericPO. If you want to use a workflow/custom document on your table, you need to provide your own PO implementation. Especially the DocAction interface must be implemented which is not done by the GenericPO (otherwise every table would be a document). 

I recommend you to read through some of the tutorials here: http://wiki.idempiere.org/en/Category:Plug-In_Development
What you may want to do is to create a plugin which provides models for your custom table via a IModelFactory. Your custom model then can implement the DocAction interface. Just take a look at the wiki or the youtube video which is linked in the article.

I hope it will help you

Mohemmed Bilal Ilyas

unread,
Oct 6, 2014, 6:14:33 AM10/6/14
to idem...@googlegroups.com
jan i have implemented my M class with docaction and after this i am getting null pointer exception like this 

===========> MLeaveApplication.set_ValueOfColumnReturningBoolean: Not found - AD_Column_ID=1002034 [13]
===========> MLeaveApplication.set_ValueOfColumnReturningBoolean: Not found - AD_Column_ID=1002034 [13]
===========> WWFActivity.onOK: (DocApprove) [13]
java.lang.NullPointerException
at org.compiere.model.PO.set_ValueOfColumnReturningBoolean(PO.java:1032)
at org.compiere.model.PO.set_ValueOfColumn(PO.java:1014)
at org.compiere.wf.MWFActivity.setVariable(MWFActivity.java:1155)
at org.compiere.wf.MWFActivity.setUserChoice(MWFActivity.java:1222)
at org.adempiere.webui.apps.wf.WWFActivity.onOK(WWFActivity.java:659)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:209)
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:141)
at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:519)
at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:446)

Jan Thielemann

unread,
Oct 6, 2014, 7:39:35 AM10/6/14
to idem...@googlegroups.com
seems that your table or model is missing a column. have you created all the necessary columns for enabling yout table as document? i guess that it is the "isApproved" column

Mohemmed Bilal Ilyas

unread,
Oct 6, 2014, 8:50:16 AM10/6/14
to idem...@googlegroups.com
Jan I have docaction,docstatus and docapproved column in my table and model but why he is giving such error

Jan Thielemann

unread,
Oct 6, 2014, 8:59:46 AM10/6/14
to idem...@googlegroups.com
From the wiki:
--Document columns
  documentno character varying
(30) NOT NULL,
  docstatus character
(2) NOT NULL,
  docaction character
(2) NOT NULL,
  processing character
(1),
  processed character
(1) NOT NULL DEFAULT 'N'::bpchar,
  c_doctype_id numeric
(10,0) NOT NULL,
  c_doctypetarget_id numeric
(10,0) NOT NULL,
  isapproved character
(1) NOT NULL DEFAULT 'Y'::bpchar,

--Document columns to enable accounting
  dateacct timestamp without time zone NOT NULL
,
  processedon numeric
,
  posted character
(1) NOT NULL DEFAULT 'N'::bpchar,
  c_currency_id numeric
(10,0) NOT NULL,

You have all these columns?

Mohemmed Bilal Ilyas

unread,
Oct 7, 2014, 1:13:10 AM10/7/14
to idem...@googlegroups.com
Jan I have added these columns now i am getting the following error 

-----------> MWFActivity.run: MWFNode[1000060-(DocApprove),Action=UserChoice:AD_Column_ID=1002080] [11]
java.lang.IllegalStateException: Status=DR - Invalid Actions: Process=AP, Doc=CO  
at org.compiere.process.DocumentEngine.processIt(DocumentEngine.java:251)
at org.compiere.model.MLeaveApplication.processIt(MLeaveApplication.java:181)
at org.compiere.wf.MWFActivity.performWork(MWFActivity.java:1108)
at org.compiere.wf.MWFActivity.run(MWFActivity.java:785)
at org.compiere.wf.MWFProcess.startNext(MWFProcess.java:370)
at org.compiere.wf.MWFProcess.checkActivities(MWFProcess.java:280)
at org.compiere.wf.MWFActivity.setWFState(MWFActivity.java:274)
at org.compiere.wf.MWFActivity.run(MWFActivity.java:802)
at org.compiere.wf.MWFProcess.startWork(MWFProcess.java:502)
at org.compiere.wf.MWorkflow.start(MWorkflow.java:696)
at org.compiere.wf.MWorkflow.startWait(MWorkflow.java:726)


Jan Thielemann

unread,
Oct 7, 2014, 2:01:07 AM10/7/14
to idem...@googlegroups.com
Take a look at the wiki. Can you see differences between the workflow there and yours? I think you have some failure in your configuration.
Reply all
Reply to author
Forward
0 new messages