Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

Contact Us

Oracle Workflows - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 
Please find yet another article written by Oracle Workflow Expert Mr Sudhakar Jukanti, whereby he explains the key API's of Oracle Workflow Engine.
     Thanks Sudhakar for yet another contribution to Oracle Apps Community. Sudhakar also happens to be a CSCP (certified supply chain professional)

The Oracle Workflow Engine:

-->       Is implemented in server-side PL/SQL.
            Combination of Tables/Views/Packages and procedures
-->       Manages the state of activities for each process instance.
-->       Determines the next activity once a prerequisite activity completes.
-->       Executes function activities automatically.
-->       Calls the Notification System to send notification messages
-->       Supports results-based branches, parallel branches, loops, and sub-processes.
-->       Can execute activities from non-savepoint environments such as database triggers and distributed transactions.
-->       Can defer activities too costly to execute in real time to background engines for processing.
-->       Maintains a history of completed activities.
-->       Detects error conditions and executes error processes.


 
Initiating a Workflow Process
We Call the Workflow Engine APIs to initiate a workflow process,
Use the CreateProcess and StartProcess APIs if you want to perform additional tasks, such as setting item attributes, after creating and before starting the process.
If you do not need to perform any additional tasks, you can use the LaunchProcess API, which is a wrapper combining the CreateProcess and StartProcess APIs.

The procedure that executes the Workflow Engine APIs to initiate a process must identify the item type and item key of the process for these APIs. The item type and item key passed to these APIs uniquely identify an item and must be passed to subsequent API calls for each specific process.


Workflow Engine Processing
Upon starting a process, the Workflow Engine:
-->       Identifies and executes the Start activity node
            Executes the Start node if it is a function, notification, or process activity
-->       Determines the next activity to transition to after completing the prerequisite activity or activities
-->       Drives through the process
           Automatically executes function activities and Send or Raise event activities
           Pauses when it encounters a notification activity or blocking activity
-->       Calls the Notification System to notify a performer
           Transitions to the next activity after the performer completes the notification,
           the blocking activity is completed, or the event message is received
-->       Stops when it encounters an End activity
 

Exception Handling
Use WF_CORE APIs to raise and catch errors in your PL/SQL procedures.

The Workflow Engine sets the status of the function activity to “ERROR” if:
          The PL/SQL procedure raises an unhandled exception
          The PL/SQL procedure returns a result beginning with “ERROR:”

If an activity encounters an error, information about the error is stored in the following columns in the WF_ITEM_ACTIVITY_STATUSES table, which are viewable from the Workflow Monitor.
-->ERROR_NAME
-->ERROR_MESSAGE

 

 
WORKFLOW ENGINE API’s
To start or run a workflow process
-->WF_ENGINE.CreateProcess creates a new runtime process for a work item.
-->WF_ENGINE.StartProcess begins execution of the specified process.
-->WF_ENGINE.LaunchProcess launches a specified process by creating the new runtime process and beginning its execution.
-->WF_ENGINE.SetItemOwner sets the owner of an existing item.
-->WF_ENGINE.SetItemUserKey sets a user-friendly identifier for an item.
-->WF_ENGINE.GetItemUserKey returns the user-friendly identifier assigned to an item.
-->WF_ENGINE.SetItemParent defines the parent/child relationship for master/detail processes.
-->WF_ENGINE.Event receives an event from the Business Event System into a workflow process.
-->WF_ENGINE.Background runs a background engine to process deferred and timed out activities and stuck processes.
-->WF_ENGINE.CreateForkProcess forks a runtime process by creating a new process that is a copy of the original.
-->WF_ENGINE.StartForkProcess begins execution of the specified new forked process.
 

 
To communicate attribute information to the Workflow Engine
-->WF_ENGINE.SetItemAttrText, WF_ENGINE.SetItemAttrNumber, WF_ENGINE.SetItemAttrDate, and WF_ENGINE.SetItemAttrEvent set the value of an item type attribute in a process.
-->WF_ENGINE.SetItemAttrTextArray, WF_ENGINE.SetItemAttrNumberArray, and WF_ENGINE.SetItemAttrDateArray set the values of an array of item type attributes in a process.
-->WF_ENGINE.GetItemAttrText, WF_ENGINE.GetItemAttrNumber, WF_ENGINE.GetItemAttrDate, and WF_ENGINE.GetItemAttrEvent return the value of an item type attribute in a process.
-->WF_ENGINE.GetItemAttrInfo returns information about an item attribute, such as its type and format.
-->WF_ENGINE.AddItemAttr adds a new item attribute to the runtime process.
-->WF_ENGINE.AddItemAttrTextArray, WF_ENGINE.AddItemAttrNumberArray, and WF_ENGINE.AddItemAttrDateArray add an array of new item type attributes to the runtime process.
-->WF_ENGINE.GetActivityAttrText, WF_ENGINE.GetActivityAttrNumber, WF_ENGINE.GetActivityAttrDate, and WF_ENGINE.GetActivityAttrEvent return the value of an activity attribute in a process.
-->WF_ENGINE.GetActivityAttrInfo returns information about an activity attribute, such as its type and format.

 

 
To communicate state changes to the Workflow Engine
-->WF_ENGINE.CompleteActivity notifies the engine that the specified activity has been completed for the item, identifying the activity by the activity node label name.
-->WF_ENGINE.CompleteActivityInternalName notifies the engine that the specified activity has been completed for the item, identifying the activity by its internal name.
-->WF_ENGINE.BeginActivity determines if the specified activity can currently be performed and raises an exception if it cannot.
-->WF_ENGINE.AssignActivity assigns an activity to another performer.
-->WF_ENGINE.GetActivityLabel returns the instance label of an activity, given the internal activity instance identification.
-->WF_ENGINE.AbortProcess aborts process execution and cancels outstanding notifications.
-->WF_ENGINE.SuspendProcess suspends process execution so that users cannot transition items to new activities.
-->WF_ENGINE.ResumeProcess returns a suspended process to normal execution status.
-->WF_ENGINE.HandleError handles any activity that has encountered an error. This API can also be called for any arbitrary activity in a process to roll back part of the process to that activity.
-->WF_ENGINE.ItemStatus returns the status and results for the root process of the specified item instance.


Sudhakar Jukanti

Comments   

0 #1 Anil Passi 2007-03-28 00:00
Hi Nikhil

Unfor tunately there are no shortcuts to learning. You need to try the tutorials that are here/elsewhere. If you get stuck, then please ask.

thanks
ani l
Quote
0 #2 NikhiL 2007-03-28 00:00
Hi anil

I am nikhil V railkar working as technical consultant in chennai
My problem is that i have told to work on workflows and will be assigned task on client site in aboroad but i am comfortable with it
i need a small favour from ,if you can send me 2 workflows with all the documents related to it i will be grateful to you

Regard
Nik hil
Quote
0 #3 swapna 2007-04-02 00:00
Hi Anil,
Would like to thank you for the knowledge that you are sharing with us. I have few questions about workflow. I would like to know what can/cannot be achieved from seeded workflows.Can you please let me know some scenarios where the functionality cannot be achieved by seeded workflow and need customization.
Thank you
Swapna
Quote
0 #4 Anil PAssi 2007-04-04 00:00
Hi Swapna

Accou nt generation is one workflow that almost always requires customization, as each customers has a unique account structure and account generation rules.

Thank s,
Anil Passi
Quote
0 #5 Anil Passi 2007-04-25 00:00
Hi,

You will have to customize the workflow in this case.

But before customization, check if this notification is based on OA Framework, in which case you can simply personalize and extend the notification.

Thanks,
Anil Passi
Quote
0 #6 A Desai 2007-04-25 00:00
Hi Anil,

Thanks a lot. Yes this this notification is based on OA Framework. How do I personalize (meaning find the name of the field from the form, map that name to create internal item attributes in WF) ?
I am able to extend the notification but these new fields not available in vanila WF (HRSSA) need to be added as new item attributes.

Thanks in advance !

A Desai
Quote
0 #7 Anil Passi 2007-04-25 00:00
You have various options to accomplish this.

The easiest way would be that you create a new StackLayout page and then include that within the notification message, just as other stacklayouts have been included for that notification.

I will try to write up a step by step approach for creating a Fwk based notification, but that will take me a week.

Thanks ,
Anil
Quote
0 #8 A Desai 2007-04-25 00:00
Hi Anil,

Thanks again for quick response. My question for the existing field available on HR Self Service (HRSSA) form, for examle National Identifier. But the same field is not available in the WF, activate when the New Hire request is submitted. How do I hook up this field available on form to the respective notification. If I create new item attibute named NATIONAL_IDENTI FIER (this is the corresponding column name in the table) and pass &NATIONAL_IDENTI FIER in the message body of the Message it does not work. Am I missing something ?

Thanks in advance !
A Desai
Quote
0 #9 A Desai 2007-04-25 00:00
Hi Anil,

Thanks again for quick response. My question for the existing field available on HR Self Service (HRSSA) form, for examle National Identifier. But the same field is not available in the WF, activate when the New Hire request is submitted. How do I hook up this field available on form to the respective notification. If I create new item attibute named NATIONAL_IDENTI FIER (this is the corresponding column name in the table) and pass &NATIONAL_IDENTI FIER in the message body of the Message it does not work. Am I missing something ?

Thanks in advance !
A Desai
Quote
0 #10 Anil Passi 2007-04-26 00:00
Hi A

Yes, if that attribute has been assigned NI Number, and if that Attribute is avaiable under the Message, then you can use &ATTR to reference its value. See if your message has contents in text or under html tab.

Thanks,
An il Passi
Quote
0 #11 sai 2007-05-04 00:00
Anil,

I have a laptop with XP Home Edition. What all softwares do i have to install, in order to work out all the examples you have provided in the site. Thanks in advance.

Sai .
Quote
0 #12 Anil Passi 2007-05-06 00:00
Hi Sai

You need Oracle database with Workflow engine installed. Also you would need Oracle WF Client which gets installed automatically with 9i or 10g client

Thank s,
Anil
Quote
0 #13 Mandar 2007-05-15 00:00
Hi Anil,

I normally refer the functional documents that you have prepared and uploaded, some of which have efforts shared by others like Sivakumar Ganesan. These pdfs have been great help in my faltering steps to learn Apps.
I am a functional consultant and hardly know about technical architecture or concepts.
What approach should I take to understand Oracle Workflows and specifically how to implement and customize those for OM module?

Than ks,

Mandar.
Quote
0 #14 satyaram 2007-05-20 00:00
hi Anil,

I have to make a report on workflow programs that are struck in process displaying at what stage they are struck.
can you help on this report.

Than ks And Regards,
Satya Ram
Quote
0 #15 Vineet 2007-05-21 00:00
Anil,

Can you please post a lession on debugging of workflow?

Th anks,
Vineet
Quote
0 #16 Murthy Ganjam 2007-05-23 00:00
one thing i would like to know is can i have list of values to a response varibale.i would like to populate it from the sql.
How to create a array type item attribute??And how to populate it?Can you plz clarify
Quote
0 #17 yogita sarang 2007-06-15 00:00
hi anil,
actually i am hrms techno-fuctiona l.i am asked to go onsite and work on workflow.
not getting how to go for preparing workflow fast.

regard s,
yogita.
Quote
0 #18 Rajesh Jha 2007-06-27 00:00
Hi Anil
THANKS for the useful info. I have a query too.

When we send a notification for some approval, the performer can
either approve, reject or request more info. While handling
appro val rejection is not a big deal. I want to send reminder
notif ication if the requestor do not replies (after approver
asks for more info). So how to handle this timeout after
requesting more info.Any suggestion would be of great help..

Thank s Again
Quote
0 #19 Anil Passi 2007-06-27 00:00
Hi Rajesh

You will find the answer in below link

http://www.google.com/search?q=site:apps2fusion.com+oracle-workflow-notifications-timeouts-with-bank-holidays-weekends-2

Yes, timeouts are possible, you can see that option in the Notification Properties window

Thank s
Anil
Quote
0 #20 AK 2007-07-07 07:34
Hi Anil,
I am customising PO Approval workflow(11.5.1 0) . one of my requirement is to
find the employee_number of an employee to whom the notification is
sent for approval. I need this employee number to call an another
custom function to do some processing. I get the person_id from
APPROVER_E MPID(Approver employee id) attribute. but to find
employee_n umber can i query from my custom package(written for
customising a workflow process in PO Approval) like select
employee _number from PER_ALL_PEOPLE_ F where person_id='1234 '. is it
the right approach to find the employee_number if we know the
person_id ?
Regards
Arun
Quote
0 #21 Anil Passi 2007-07-08 08:20
Hi AK
Yes your approach is right.

n_appro ver_person_id :=
wf_engine.getit emattrnumber
(
itemtype => itemtype
,itemkey => itemkey
,aname =>'APPROVER_EMP ID'
) ;


FUNCTION get_person_numb er(p_person_id IN INTEGER) RETURN VARCHAR2 IS
CURSOR c_get IS
SELECT employee_number
FROM per_all_people_ f
WHERE person_id = p_person_id;
p_get c_get%ROWTYPE;
BEGIN
OPEN c_get;
FETCH c_get
INTO p_get;
CLOSE c_get;
RETURN p_get.employee_ number;
END get_person_numb er;

X_person_n umber := get_person_numb er( p_person_id =>n_approver_pe rson_id) ;

Thanks,
Anil Passi
Quote
0 #22 AK 2007-07-08 08:56
Hi Anil,
Thanks for your response.much appreciated
Aru n
Quote
0 #23 William 2007-07-16 19:01
HELP !!!

If in the CreateProcess the Process already exists, what must make ?
Please, answer in my e-mail.

ps: Sorry for my English, but i am brazilian and don't speak english.
Quote
0 #24 mondher 2007-08-29 15:29
hi anil
Thank you for your help understanding workflow. I try to run the example in your first
lesson but i have problem to execute wf_engine package . i try to execute it
from owf_mgr but same result. the package wf_engine is in the schema and status is valid
the oracle database is 10.2.
best regards

mondhe r
Quote
0 #25 Anil Passi 2007-08-30 05:35
Hi Mondher

To implement the WF tutorials on this site, you must execute the same from apps schema.
If you are using standalone version, then please note that it has been de-supported

T hanks,
Anil
Quote
0 #26 Muralidhar 2007-08-30 21:18
Hi,

I am new into worklfow. However our company is using oracle workflow since last few years.

I want to process stuck jobs,

Eg: I have a jobid 1 which is completed import task, but while executing export task it got failed due to table space issue. Now the table space issue has been resolved the but job is not getting completed.

Please let me know how can i run export task, i don't want to run using launch process because various jobs are stuck at various stages. I want something it should start from wherever it stopped earlier.

Thank s & Regards,
Murali dhar S
Quote
0 #27 Ramelu 2007-09-04 14:40
Hi Anil,

I have an issue in workflow where the workflow notification has been sent to the person who does not belongs to particular workflow. Eg: The workflow notification is coming to the user for a particular order number, where the user is no way related to that order number.The user want to stop this notification and he also want to know where does it comes from.
Can you please suggest.

Regar ds,
Ram.
Quote
0 #28 Nasar Zia 2007-09-15 11:15
Hi anil

I am getting WF status no approver available ,Check approval group ,approver hierarchy in purchasing ,I check account range and amount for approver group it is all set right,I run request for employee hierarchy and synchromization WF tables,

The proble is employee Ashok not in the hirarchy raised a iproc requisition and forwarded for approval to emp Veneet he is in approvar hirarchy but having limit to approve only 50,000 amount so it should go to next level that is employee Jagdeep but it does not reach to him and requisition status says incomplete.

I checked workflow its status is no approver available.Pleas e send solurion for the same or possible cause of problem.

Best Regards
Nasar Zia
Quote
0 #29 Vamsi 2007-09-17 21:05
Hi Anil,

My requirement is When a dispute is created in Oracle through collections form, need to capture all the details (customer_trx_i d, amount) into a JMS queue. For this scenario can we customize the existing workflow (ARCMREQ, which is internally invoked by AR_CREDIR_MEMO_ API_PUB package) to add a process/functio n?

Another question is, Does Oracle support to modify the standard workflow?

Plea se provide your valuable suggestions....

Thanks,
Vamsi
Quote
0 #30 Anil Passi 2007-10-08 13:47
Hi Vamsi

No customization can ever be safe.
But given that there is no business event, you can consider customizing the workflow.

If there is merely one screen from which disputes are being created, then you can also consider writing FP/CUSTOM.pll

Thanks,
Anil Passi
Quote
0 #31 AllaKishore 2007-10-29 17:42
Hi,

Can you please let me know hoe to send same notifications to more than one user?

Thanks and regards
Alla Kishore
Quote
0 #32 Anil Passi 2007-10-29 17:48
Please search Metalink for "Expand Roles"
That will explain.

For example, a responsibility is a role, and all users assigned to the responsibility can be notified if notification gets sent to resp role

thanks
an il
Quote
0 #33 Amit Nene 2007-12-19 16:44
Hi,
When we create a dispute, a line gets created in the history tab of the 'Collection Agent' screen with status as 'Pending Approval'. Our requirement is that whenever a line gets created, it should have the status as either 'Applied' or 'Closed'.
The workaround that we are thinking is to bypass all the approvals required in between. I need your inputs as how safe this customization can be?
And what can be the impact on the standard oracle process?
Also it will be very nice if you can tell me what all changes I might need to make in the workflow to achieve the results?
Thanks in advance,
Amit
Quote
0 #34 SDadi 2008-03-12 11:03
Hi Anil,

This Santosh, working as Apps Consultant in Oracle from past 2.5 yrs. I am planning to take CSCP for OM. I have oracle study guides. Do you suggest any other books/use cases that would be helpful with my preperation?

T hanks,
Santosh.
Quote
0 #35 Raquel 2009-04-29 04:14
Hi ,

I am trying to use the procedure WF_ENGINE.Handl eError to resubmit an Execute Concurrent Program activity as below:

begin
w f_engine.handle error(,,'EXECUT ECONCPROG','RET RY',NULL);
COMM IT;
end;
/

When I execute the above block, the stuck activity gets forced to completion and the next activity (which is actually the same errored activity, not the next in sequence) shows as errored. Please see the below activity statuses:

**** Activity Statuses

Begin Date Activity Status Result User
---------- -------- --------------- --------------- --------------- -------- --------------- ---------------
29-APR-09 15:36:15 ROOT/XAS EForm Approval Process ACTIVE #NULL
29-APR-09 15:36:15 XAS EForm Approval Process/Start COMPLETE #NULL
29-APR-09 15:39:04 XAS EForm Approval Process/Execute Concurrent COMPLETE #FORCE
Program

29-APR -09 15:52:32 XAS EForm Approval Process/Execute Concurrent ERROR #EXCEPTION
Program

There is another concurrent program to be executed in the same workflow process which has the same internal name EXECUTECONCPROG .

Would appreciate anyone's inputs on this issue.

Thanks.

Raquel
Quote
0 #36 Raquel 2009-04-29 04:18
Adding on, the PL/SQL block that I am trying to execute is as below:

begin
wf_engine.hand leerror(l_itemt ype,l_itemkey,' EXECUTECONCPROG ','RETRY',NULL) ;
COMMIT;
end;
/

Please ignore the earlier one.

Thanks.

Raquel
Quote
0 #37 sreehariReddy.l 2009-08-03 06:02
Hi Sudhakar,

Coul d you please give me Information about CSCP and also please send me if you any sof copy regarding to CSCP . My mail ID :

Thanks.
Sreeh ari
Quote
0 #38 Sri3007 2010-07-10 07:35
HI,

I want to take the Invoice id from the AP Invoice form and copy it to an Account generator workflow attribute. I need to get the invoice details with that invoice id.
Please tell me the approach of this logic.

THanks in Advance..

Srin ivasan.
Quote
0 #39 MukeshK 2010-09-10 11:20
Hi Anil,

I am usring the following API to make some change in PO, it works fine and change the revision of the PO and submits the approval workflow.

Now my requirement is that, this PO should bypass the approval process and PO get approved automatically. Can u suggest what I can do (either call any API or ......)?, but I don't want to change the exisitng approval procees that will be there for other cases.

You quick response is highy appriciated.

l _result := po_change_api1_ s.update_po(
'1 2345', -- X_PO_NUMBER VARCHAR2,
NULL ,--X_RELEASE_NU MBER NUMBER,
9 ,-- X_REVISION_NUMB ER NUMBER,
1 ,-- X_LINE_NUMBER NUMBER,
1 ,-- X_SHIPMENT_NUMB ER NUMBER,
NULL ,--NEW_QUANTITY NUMBER,
NULL ,--NEW_PRICE NUMBER,
'01-SEP -2010',--NEW_PR OMISED_DATE DATE,
'Y' ,--LAUNCH_APPRO VALS_FLAG VARCHAR2,
NULL ,--UPDATE_SOURC E VARCHAR2,
'1.0' ,--VERSION VARCHAR2,
NULL, --X_OVERRIDE_DA TE DATE := NULL,
X_API_ERR ORS, --X_API_ERRORS, --X_API_ERRORS OUT NOCOPY PO_API_ERRORS_R EC_TYPE,
'Kumar , Mukesh' --p_BUYER_NAME VARCHAR2 default NULL /* Bug:2986718 */
);


Thanks & Regards
Mukesh
Thanks & Regards
Mukesh
Quote
0 #40 Aries 2010-12-27 13:18
Dear Anil,

I am unable to find Oracle Apps 11.5.10.2 Workflow Table's ER diagram.

I have read may pdfs but mostly talk about Workflow builder and only few tables.

I just need a ER-Diagram of workflow tables.

And psudo logic of workflow from start to finish (in terms of tables which updated first and which updated last)

Thanks in advance
Regards
Quote
0 #41 Sudheer 2015-09-24 10:09
Hi,

I need to develop the custom workflow in HRMS in such a way that when an employee applies a leave in absence management window then my work flow need to fire and the approval notifications should go the respective managers. I have developed the workflow and the notifications are going the respective managers but i'm finding difficulty in initiating the workflow when an employee went to absence management window and applying a leave there. Actually i'm running the workflow from back end Toad by using create process and start process procedures.

Please help me here in how to start the workflow when an employee went to absence management window applies a leave there.
Quote

Add comment


Security code
Refresh

More articles from this author

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213
14151617181920
21222324252627
282930    

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner