Showing posts with label WorkFlow. Show all posts
Showing posts with label WorkFlow. Show all posts

Thursday, 6 December 2018

Workflow Engine API’s

WF_ENGINE  is a workflow package which provides APIs that can be called by an application program or a workflow function in the runtime phase to communicate with the Workflow Engine and to change the status of workflow process activities.


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.

/* Formatted on 7/13/2015 6:01:27 PM (QP5 v5.163.1008.3004) */
--<<Sample Code>>


DECLARE
   l_itemtype   VARCHAR2 (30) := 'XX_TEST';
   l_itemkey    VARCHAR2 (300) := 'TEST';
BEGIN
   BEGIN
      wf_engine.createprocess (l_itemtype, l_itemkey, 'XX_MAIN_TEST');
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('Error in create process:' || SQLERRM);
   END;

   BEGIN
      wf_engine.setitemuserkey (itemtype   => l_itemtype,
                                itemkey    => l_itemkey,
                                userkey    => 'USERKEY: ' || l_itemkey);
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('Error in set userkey process:' || SQLERRM);
   END;


   BEGIN
      wf_engine.setitemowner (itemtype   => l_itemtype,
                              itemkey    => l_itemkey,
                              owner      => 'SYSADMIN');
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('Error in set owner process:' || SQLERRM);
   END;

   BEGIN
      wf_engine.startprocess (l_itemtype, l_itemkey);
      DBMS_OUTPUT.put_line ('Done');
      DBMS_OUTPUT.put_line ('Process started');
      COMMIT;
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line ('Error in set owner process:' || SQLERRM);
   END;
END;



/

Thursday, 14 September 2017

Service Contract Workflow struck

Issue:


we have created contract 952416 through EMR OKS Service Contracts User DMC. this should have been routed to Ryan Ransom for approval. this is not showing on his Navigation worklist.Below is workflow monitor and the Administration “Submitted” status.Can you please assist pushing this through as we are testing and need to get this approval to continue with our testing.
Resp: EMR OKS Service Contracts User DMC


Cause: Profile set to CHRIS_EWART at responsibility level.
Solution: Responsibility level profile option updated as RYAN_RANSOM


Wednesday, 13 May 2015

2. Workflow with Approve and Reject in R12


1. Create New Item

2. Create New Process
c
3. Create New Notification
4. Create Message with Body

5. Assign Message in Notification
6. Create Process design with Start and End button from standard

7. Set the Start Button Properties
8. Set the End Button Properties
9. Create New Lookup with new lookup codes
10. Approve Lookup Code
11. Reject Lookup Code
12. Drag the Notification in Process design, set the Message Properties
13. Save file

14. Set the Lookup type in Message Result
14. Complete the Design with Approve and Reject and Validate the design
15. Connect to Database


17. Initiate/Run the program with Item Name.

CREATE SEQUENCE XX_LV_WF_SEQ START WITH 10 INCREMENT BY 1;



BEGIN

wf_engine.createprocess(itemtype => 'XXWF',
                        itemkey  =>  XX_LV_WF_SEQ.NEXTVAL,
                        process  =>  'XXWF_LV_MGM_SYS_PROCESS'
                        );


wf_engine.startprocess ( itemtype => 'XXWF',
                        itemkey  =>  XX_LV_WF_SEQ.currval
                       );
commit;

END;

16.Login to Apps

17. Navigate to Developer Studio from Workflow Administrator web applications
18. Click on Approve or Reject Button



1. Basic Workflow Development Steps

1. create new process




2 Create Notification

3. Create Message

4. Create Body with Message

5. Assign the message in Notification Properties

6. Design Process with Start and End button

7. Drag Notification Into Design process. Set the User name as Performer.

8. Save File

9. Connect to Database


10. Validate the Design

11. Initiate/Run the Program with Short Name

CREATE SEQUENCE XX_LV_WF_SEQ START WITH 10 INCREMENT BY 1;

  
BEGIN

wf_engine.createprocess(itemtype => 'XXDEMOWF',
                        itemkey  =>  XX_LV_WF_SEQ.NEXTVAL,
                        process  =>  'XXWFPROCESS'
                        );


wf_engine.startprocess ( itemtype => 'XXDEMOWF',
                        itemkey  =>  XX_LV_WF_SEQ.currval
                       );
commit;

END;

12. Login Apps with User Name provided as Performer in Node. Navigate to Notifications, See the Results.