Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Workflow doesnt starts intermittently

951914Jul 26 2012 — edited Oct 2 2012
Hello friends,
I have a very weird issue occuring in PROD. Looking at the code i am not able to find any fault and we are unable to reproduce this in any of the other environments. We have build a pretty simple workflow which kicks off when user click a button on an OAF page (all custom).
The code in controller is as follows:
------------------------
// When user clicks on submit do business validations and then execute below.
OADBTransaction tx = pageContext.getApplicationModule(webBean).getOADBTransaction();
String upsql =
"BEGIN xx_overtime_pkg.start_overtime_wf(:1, :2, :3); END;";
OracleCallableStatement UpdStmt =
(OracleCallableStatement)tx.createCallableStatement(upsql, 1);
try {

UpdStmt.setString(1, empNum);
UpdStmt.setString(2, weekEnded);
UpdStmt.setString(3, txnId2.toString());
UpdStmt.execute();
tx.commit();
} catch (Exception e) {

throw OAException.wrapperException(e);
}
-------------------------------

------------------------------------
The code in xx_overtime_pkg.start_overtime_wf is also pretty simple.
procedure start_overtime_wf(
p_emp_number in varchar2,
p_week_ended in varchar2,
p_transaction_id in varchar2)
is
l_itemtype varchar2(30) := 'XXWFLOW'; l_week_ended varchar2(20); l_week_ended_dt date;
l_itemkey varchar2(30); l_person_id number;

begin
l_week_ended := substr(p_week_ended,1,10);
l_week_ended_dt := to_date(l_week_ended, 'RRRR-MM-DD');
l_itemkey := p_transaction_id;

//some calculations for employee's manager fnd user etc.
wf_engine.createprocess(l_itemtype,l_itemkey,'XX_OVERTIME_PRC');
wf_engine.setitemuserkey(itemtype => l_itemtype,
itemkey => l_itemkey,
userkey => 'USERKEY: '||l_itemkey);
wf_engine.setitemowner(itemtype => l_itemtype,
itemkey => l_itemkey,
owner => l_role1);
// set some item attributes etc.
wf_engine.setitemattrnumber(itemtype => l_itemtype
,itemkey => l_itemkey
,aname => 'TRANSACTION_ID'
,avalue => to_number(p_transaction_id));
wf_engine.startprocess(l_itemtype, l_itemkey);
end start_overtime_wf;
--------------------------------------------------------------------------------------------------------------

We have around 200 transactions in a day for this workflow. In this there are around 4-5 transactions everyday where the workflow doesnt starts. For the same user workflow will start fine next day or previously. No error message or anything else. We know that user has infact clicked on submit button and is not bluffing because after clicking and before firing workflow a column update is made through EO-VO and that happens fine.
Cannot produce wfstat because infact there is no workflow with the particular item key.

This is causing a lot of headache for the client and myself since we have to manually clean up records every week and doesnt gives agood impression to end user.

Please advice. An early reply will be highly appreciated.

Thanks,
Gyanesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2012
Added on Jul 26 2012
4 comments
369 views