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)
--
--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,