Categories
Approval Workflow Engine

Create A Simple AWE PeopleSoft

PeopleSoft AWE ( Approval Workflow Engine ) aka Approval Framework is part of PeopleTools Enterprise Component.
In this article will discuss detailed guideline of creating sample AWE workflow.

Sample AWE Process Flow

awe

This Sample AWE Workflow contains 4 Parts.

  1.  Part 1 – Contains Record , Component , Pages & Menu Creation ( This Part )
  2.  Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal  ( Create A Simple AWE PeopleSoft Part – 2 )
  3.  Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )
  4. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

So Lets Start. Project can be share upon request , you need to like our Facebook page DBTutorBlog  then share your email address i will mail you.

Version that is used in this sample awe project PeopleTools 8.51.25 , Application Release HRMS 9.1 , Database – Oracle.
This Articles will not describe why to Use PeopleSoft Approval Framework instead of legacy workflow system.you are requested to follow PeopleBook Documentation. Here is the link – Approval Framework

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Please Follow AWE Workflow Other 4 Parts.

  1. Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part – 2 )
  2. Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )
  3. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

Hope this helps 🙂

Categories
Approval Workflow Engine PeopleCode

Create A Simple AWE PeopleSoft Part – 2

This Section will Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal.

Please Follow AWE Workflow Other 4 Parts.

  1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
  2. Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )
  3. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Please Note that: in Generic Template we have email bind variables like %2 and %3 etc..

%1 – always Replaced by AWE system itself by putting URL.

%2 or %3 is Email Template Bind Variable. So for filling this bind variables we need to create a Standalone SQL Defination from App Designer.
Basically it a select statement based on column name your are passing on generic template bind variables with  Transaction Keys as Input

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

As of Now we have successfully completed setup from PIA. Now its time to check Counter table to insert Your AWE Transaction Cross Reference Record ( XREF Record.)

So, using  above this Select SQL please check if your XREF Record Already there in IDS table.If already there then not required insert statement. but if you not found that your XREF Record was not entired then using this Insert Stament insert data in IDS Table.

 

Please Follow AWE Workflow Other 4 Parts.

  1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
  2. Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )
  3. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

Hope this helps 🙂

Categories
Approval Workflow Engine PeopleCode

Create A Simple AWE PeopleSoft Part – 3

This Section will discuss Working & testing AWE Workflow in PeopleSoft Portal.

Please Follow AWE Workflow Other 4 Parts.

  1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
  2. Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part – 2 )
  3. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

We will now check our AWE Transaction.

  • Request Will Raise by KU0007 – Betty Locherty . KU0007 Is the requester or originator of this transaction
  • After Successful Request Launch it goes his/her supervisor. it this cased it will goes To:
    Senior Vice President-Finance KU0003 Madam Jean Parsons because KU0007 Reports to KU0003 based on Job Information Page.
  • After KU0003 approve it will goes to Admin Level Approval which is Final Level approval
  • When Admin Level Approver (in our cases “HCADMIN” is the Admin as we provide admin role to him) Approve it then close the transaction.
  • So Lets follow the steps,

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Please Follow AWE Workflow Other 4 Parts.

    1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
    2. Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part – 2 )
    3. Part 4 – Contains Necessary Record , Component Record , Application Packages PeopleCode that need to write for AWE Workflow ( Create A Simple AWE PeopleSoft Part – 4 )

    hope this helps 🙂

    Categories
    Approval Workflow Engine PeopleCode

    Create A Simple AWE PeopleSoft Part – 4

    This Section will discuss about various PeopleCode that need to write In order to AWE Work properly.

    Please Follow AWE Workflow Other 4 Parts.

    1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
    2. Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part – 2 )
    3. Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )

     

    PeopleCode

    People Code TypeZZ_AWE_HDR Component Record Field Level
    Event NameFieldChange
    Object NameZZ_AWE_ACTN_WRK.EOAW_SUBMIT
    /** Submit Button **/
    
    Component string &c_sAppr_Action;
    Component string &c_sSubmitBtn;
    
    &c_sAppr_Action = "S";
    
    If ( Not GetRow().IsChanged) Then
       /** force save processing **/
       SetComponentChanged();
    End-If;
    
    DoSave();
    &c_sSubmitBtn = "Y";
    
    
    People Code TypeZZ_AWE_HDR Component Record Field Level
    Event NameFieldChange
    Object NameZZ_AWE_ACTN_WRK.EOAW_SAVE
    /** Data Save As Draft **/
    
    Component string &c_sAppr_Action;
    Component string &c_sSaveDraftBtn;
    
    &c_sAppr_Action = "V";
    
    If ( Not GetRow().IsChanged) Then
       /** force save processing **/
       SetComponentChanged();
    End-If;
    
    DoSave();
    &c_sSaveDraftBtn = "Y";

     

    People Code TypeZZ_AWE_HDR Component Record Field Level
    Event NameFieldChange
    Object NameZZ_AWE_ACTN_WRK.EOAW_DENY
    /** Deny Button */
    
    Component string &c_sAppr_Action;
    
    &c_sAppr_Action = "D";
    If ( Not GetRow().IsChanged) Then
       /** force save processing **/
       SetComponentChanged();
    End-If;
    DoSave();
    People Code TypeZZ_AWE_HDR Component Record Field Level
    Event NameFieldChange
    Object NameZZ_AWE_ACTN_WRK.EOAW_APPROVE
    /** Approve Button **/
    
    Component string &c_sAppr_Action;
    
    &c_sAppr_Action = "A";
    If ( Not GetRow().IsChanged) Then
       /** force save processing **/
       SetComponentChanged();
    End-If;
    DoSave();
    People Code TypeZZ_AWE_HDR Component Record
    Event NameRowInit
    Object NameZZ_AWE_HDR
    If %Mode = %Action_Add Then
       ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
    End-If;
    People Code TypeZZ_AWE_HDR Component
    Event NamePostBuild
    Object NameZZ_AWE_HDR
    /***
     * AWE Post Build Code
     * Application developers should instantiate ApprovalManager & LaunchManager class as a component-scoped variable.
     * The best place to initialize ApprovalManager & LaunchManager class is in the component post-build event.
     ***/
    
    /** Import Approval Framework Base Classes **/
    import EOAW_CORE:LaunchManager;
    import EOAW_CORE:ApprovalManager;
    
    /** Declare functions*/
    Declare Function createStatusMonitor PeopleCode EOAW_MON_WRK.EOAW_FC_HANDLER FieldFormula;
    
    /** Declare Variables **/
    Component EOAW_CORE:LaunchManager &c_aweLaunchManager;
    Component EOAW_CORE:ApprovalManager &c_aweApprovalManager;
    Component string &c_sAppr_Action;
    Component string &c_AWEProcessDefnID;
    Component Record &headerRec; /** We have set it Component Level, So Get Acess to Others Component **/
    Local boolean &isApprover = False; /** Checl if User is Approver for this transaction **/
    
    
    /** Set Header Record, **/
    &headerRec = GetRecord(Record.ZZ_AWE_HDR);
    
    /** Get Assigned Approval Process Id for selected transaction From Workflow Transaction Page **/
    &c_AWEProcessDefnID = "ZZ_AWE_SAMPLE"; /** Get EO Process Defn ID **/
    
    /** Initialize the launch and approval managers. ApprovalManager will need reinitialization on submit */
    &c_aweLaunchManager = create EOAW_CORE:LaunchManager(&c_AWEProcessDefnID, &headerRec, %UserId);
    &c_aweApprovalManager = create EOAW_CORE:ApprovalManager(&c_AWEProcessDefnID, &headerRec, %UserId);
    
    /** Set Up Approval Process Defination **/
    &c_aweLaunchManager.definition = "ZZ_AWE_SAMPLE";
    
    
    /** Show Transaction Status Monitor & Save & Submit Button **/
    If &c_aweApprovalManager.hasAppInst Then
       
       createStatusMonitor(&c_aweApprovalManager.the_inst, "D", Null, False);
       ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = False;
       
       /* Toggle all fields with the exception of the status monitor as display only.  We cannot
    change the page property as the status monitor fields would be disabled */
       Local Rowset &Rs = GetLevel0();
       For &i = 1 To &Rs(1).RecordCount
          &Rec = &Rs(1).GetRecord(&i);
          For &j = 1 To &Rec.fieldcount
             &Rs(1).GetRecord(&i).GetField(&j).DisplayOnly = True;
          End-For;
       End-For;
       
    Else
       ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = True;
       ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = True;
    End-If;
    
    
    /*** Show Approve & Deny Button Based on Condition ***/
    If &c_aweApprovalManager.hasPending And
          &c_aweApprovalManager.GetParticipant(%UserId) = "AA" Then
       ZZ_AWE_ACTN_WRK.EOAW_APPROVE.Visible = True;
       ZZ_AWE_ACTN_WRK.EOAW_APPROVE.DisplayOnly = False;
       ZZ_AWE_ACTN_WRK.EOAW_DENY.DisplayOnly = False;
       ZZ_AWE_ACTN_WRK.EOAW_DENY.Visible = True;
       ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = False;
    Else
       ZZ_AWE_ACTN_WRK.EOAW_APPROVE.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_DENY.Visible = False;
    End-If;
    /*** Show Approve & Deny & Save & Submit Button Based on Condition End ***/
    People Code TypeZZ_AWE_HDR Component
    Event NameSavePreChange
    Object NameZZ_AWE_HDR
    /** Declare Component Variables **/
    Component string &c_sSaveDraftBtn;
    Component string &c_sSubmitBtn;
    Component string &c_sAppr_Action;
    
    
    If %Mode = %Action_Add Or
          %Mode = %Action_UpdateDisplay Or
          %Mode = %Action_UpdateDisplayAll Then
       
       /** Perform Button Action **/
       /** When Submit **/
       If &c_sSubmitBtn = "Y" Then
          ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
          ZZ_AWE_HDR.SUBMIT_DTTM.Value = %Datetime;
          &c_sSubmitBtn = "";
       End-If;
       
       /** When SaveAsDraft **/
       If &c_sSaveDraftBtn = "Y" Then
          ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
          ZZ_AWE_HDR.WF_STATUS.Value = "V"; /** Set Data Saved As Draft **/
          ZZ_AWE_HDR.SUBMIT_DTTM.Value = %Datetime;
          &c_sSaveDraftBtn = "";
       End-If;
       
    End-If;


    People Code TypeZZ_AWE_HDR Component
    Event NameSavePostChange
    Object NameZZ_AWE_HDR
     /***
     * AWE SavePostChange Code
     * This Save Post Change Code Will Handled When Submit, Approve & Deny Action Performed
     **/
    
    /** Import Approval Framework Base Classes */
    import EOAW_CORE:LaunchManager;
    import EOAW_CORE:ApprovalManager;
    
    /** Declare functions*/
    Declare Function createStatusMonitor PeopleCode EOAW_MON_WRK.EOAW_FC_HANDLER FieldFormula;
    
    Component EOAW_CORE:LaunchManager &c_aweLaunchManager;
    Component EOAW_CORE:ApprovalManager &c_aweApprovalManager;
    
    Component string &c_sAppr_Action;
    Component string &c_AWEProcessDefnID;
    Component Record &headerRec; /** We have set it Component Level, So Get Acess to Others Component **/
    
    
    Local boolean &IsActionTaken = True;
    Local string &sActionMsgString = "";
    
    Evaluate &c_sAppr_Action
    When "V"
       /* When Data Saved As Draft */
       Break;
    When "S"
       /* Call DoSubmit, passing in current header info.  ;*/
       /** It is always safe to call this method (as long as the header record being passed in is valid!), */
       &c_aweLaunchManager.SetHeader(&headerRec);
       try
          
          If &c_aweLaunchManager.hasAppDef Then
             If &c_aweLaunchManager.submitEnabled Then
                &c_aweLaunchManager.DoSubmit();
             End-If;
          End-If;
          
       catch Exception &Ex1
          &sActionMsgString = "Unable to DoSubmit on the ApprovalManager." | Char(10) | " Error - " | &Ex1.DefaultText;
          &IsActionTaken = False;
       end-try;
       If (&c_aweLaunchManager.hasAppInst) Then
          /** Initialize Approval Manager if transaction was submitted */
          &c_aweApprovalManager = create EOAW_CORE:ApprovalManager(&c_aweLaunchManager.txn.awprcs_id, &headerRec, %UserId);
       End-If;
       Break;
    When "A"
       /* Call DoApprove, passing in current header info. */
       try
          &c_aweApprovalManager.DoApprove(&headerRec);
       catch Exception &Ex2
          &sActionMsgString = "Unable to DoApprove on the ApprovalManager." | Char(10) | " Error - " | &Ex2.DefaultText;
          &IsActionTaken = False;
       end-try;
       Break;
    When "D"
       /* Call DoDeny, passing in current header info. */
       try
          &c_aweApprovalManager.DoDeny(&headerRec);
       catch Exception &Ex3
          &sActionMsgString = "Unable to DoDeny on the ApprovalManager." | Char(10) | " Error - " | &Ex3.DefaultText;
          &IsActionTaken = False;
       end-try;
       Break;
    When-Other
       &sActionMsgString = "Error - Invalid Action.";
       &IsActionTaken = False;
    End-Evaluate;
    
    
    /** Show Specified Action Message Box **/
    If &sActionMsgString <> " " And
          &IsActionTaken = False Then
       MessageBox(0, "", 0, 0, &sActionMsgString);
       /* Exit message processing. */
       Exit (0);
    End-If;
    
    
    /** Show Transaction Status Monitor & Save & Submit Button **/
    If &c_aweApprovalManager.hasAppInst Then
       
       createStatusMonitor(&c_aweApprovalManager.the_inst, "D", Null, False);
       
       ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_APPROVE.Visible = False;
       ZZ_AWE_ACTN_WRK.EOAW_DENY.Visible = False;
       
       /* Toggle all fields with the exception of the status monitor as display only.  We cannot
    change the page property as the status monitor fields would be disabled */
       Local Rowset &Rs = GetLevel0();
       For &i = 1 To &Rs(1).RecordCount
          &Rec = &Rs(1).GetRecord(&i);
          For &j = 1 To &Rec.fieldcount
             &Rs(1).GetRecord(&i).GetField(&j).DisplayOnly = True;
          End-For;
       End-For;
       
    End-If;
    
    /* Reset &Action to Null */
    &c_sAppr_Action = " ";

    People Code TypeApplication Package PeopleCode
    Event NameOnExecute
    Object NameZZ_AWE_EVENT_HANDLR
     /***
     * Approval Event Handler Class
     * This Handle All the AWE Events
     *Event values include:
     */
    
    import EOAW_CORE:ApprovalEventHandler;
    import EOAW_CORE:ENGINE:AppInst;
    import EOAW_CORE:ENGINE:UserStepInst;
    import EOAW_CORE:ENGINE:StepInst;
    import EOAW_CORE:ENGINE:Thread;
    
    class ApprEventHandler extends EOAW_CORE:ApprovalEventHandler
       method ApprEventHandler();
       
       method OnProcessLaunch(&appinst As EOAW_CORE:ENGINE:AppInst);
       method OnStepComplete(&stepinst As EOAW_CORE:ENGINE:StepInst);
       method OnHeaderApprove(&appinst As EOAW_CORE:ENGINE:AppInst);
       method OnHeaderDeny(&userinst As EOAW_CORE:ENGINE:UserStepInst);
       
    private
       instance Record &HeaderRecord; /** Declare Record Instance **/
    end-class;
    
    
    /** Constructor */
    method ApprEventHandler
       %Super = create EOAW_CORE:ApprovalEventHandler();
       &HeaderRecord = CreateRecord(Record.ZZ_AWE_HDR); /** Set the Header Record **/
    end-method;
    
    
    method OnProcessLaunch
       /+ &appinst as EOAW_CORE:ENGINE:AppInst +/
       /+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnProcessLaunch +/; /** Set Approval Prcoess **/
       
       Local string &HdrRecTopKeyValue;
       
       &appinst.thread.SetAppKeys(&HeaderRecord);
       &HeaderRecord.SelectByKey();
       
       /** Retrieve Header field values **/
       &HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
       
       /** Update the Workflow Status **/
       Local Record &recHdrRecord = CreateRecord(Record.ZZ_AWE_HDR);
       &recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
       If &recHdrRecord.SelectByKey() = True Then
          &recHdrRecord.GetField(Field.WF_STATUS).Value = "I"; /** Set InApproval Process **/
          &recHdrRecord.Update();
          GetLevel0().Refresh();
       End-If;
       
    end-method;
    
    
    method OnStepComplete
       /+ &stepinst as EOAW_CORE:ENGINE:StepInst +/
       /+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnStepComplete +/
       
       Local string &HdrRecTopKeyValue;
       
       &stepinst.path.thread.SetAppKeys(&HeaderRecord);
       &HeaderRecord.SelectByKey();
       
       /** Retrieve Header Key field values **/
       &HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
       
       /** Update the Workflow Status **/
       Local Record &recHdrRecord = CreateRecord(Record.ZZ_AWE_HDR);
       &recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
       If &recHdrRecord.SelectByKey() = True Then
          &recHdrRecord.GetField(Field.WF_STATUS).Value = "I";
          &recHdrRecord.Update();
          GetLevel0().Refresh();
       End-If;
       
    end-method;
    
    
    method OnHeaderApprove
       /+ &appinst as EOAW_CORE:ENGINE:AppInst +/
       /+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnHeaderApprove +/
       
       Local string &HdrRecTopKeyValue;
       
       &appinst.thread.SetAppKeys(&HeaderRecord);
       &HeaderRecord.SelectByKey();
       
       /** Retrieve Header field values **/
       &HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
       
       /** Update the Workflow Status **/
       Local Record &recHdrRecord = CreateRecord(Record.ZZ_AWE_HDR);
       &recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
       If &recHdrRecord.SelectByKey() = True Then
          &recHdrRecord.GetField(Field.WF_STATUS).Value = "A";
          &recHdrRecord.Update();
          GetLevel0().Refresh();
       End-If;
       
    end-method;
    
    
    method OnHeaderDeny
       /+ &userinst as EOAW_CORE:ENGINE:UserStepInst +/
       /+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnHeaderDeny +/
       
       Local string &HdrRecTopKeyValue;
       
       &userinst.thread.SetAppKeys(&HeaderRecord);
       &HeaderRecord.SelectByKey();
       
       /** Retrieve Header field values **/
       &HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
       /** Update the Workflow Status **/
       Local Record &recHdrRecord = CreateRecord(Record.ZZ_AWE_HDR);
       &recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
       If &recHdrRecord.SelectByKey() = True Then
          &recHdrRecord.GetField(Field.WF_STATUS).Value = "D";
          &recHdrRecord.Update();
          GetLevel0().Refresh();
       End-If;
       
    end-method;

    Please Follow AWE Workflow Other 4 Parts.

    1. Part 1 – Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE PeopleSoft )
    2. Part 2 – Contains AWE Transaction Registration , Configuration , Approval Process & Generic Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part – 2 )
    3. Part 3 – Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User ( Create A Simple AWE PeopleSoft Part – 3 )

    Please share your comments & let me know if you stuck on this Sample AWE Workflow.I will also share some advanced topics on approval framework , so stay tune.

    Categories
    Approval Workflow Engine PeopleCode

    Migrate AWE Transaction Using Data Mover Script

    Here is data mover script that need to migrate Approval Workflow Transaction one environment to another also DEV or UAT to Production.

    If you AWE Transaction Completely new of fresh and you want to migrate to production then no backup is not required because your transaction is absent on production, but if you have some changes on AWE Configuration specially Approval Process Setup then it is good idea to take backup of current copy using this script.
    Please Change the Transaction Name in this script as Per your requirements

    AWE Transaction Configuration Data Mover Export Script

    -- Approval Process Definitions AWE Migration
    -- Begin export from UAT to PROD
    -- If Transaction is Fresh or New then no need to backup in Production else
    -- Please Take Backup of Production Copy For Specific Transaction Using this script
    -- Transaction Name:
    -- Export File Name : ZZ_EXP_EXPORT.dms
    -- Import File Name : ZZ_EXP_IMPORT.dms
    
    
    SET OUTPUT D:\awe_dms_data\ZZ_EXP.dat;
    SET LOG E:\awe_dms_data\ZZ_EXP_EXPORT.log;
    
    
    -- Export Transaction Registry and Configuration
    EXPORT PS_EOAW_ADMMON_CFG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_MONDIS_DTL WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_MONDIS_HDR WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_USRMON_CFG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_USRMON_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TXN WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TXN_CFG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TXN_LBL WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    Export PS_EOAW_TXN_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TXN_LVL WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    
    
    --Export Transaction Notifications
    EXPORT PS_EOAW_NOTIFY WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_NOTIFYDEF WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_NOT_USER WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_NOT_USRDEF WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    
     
    -- Export User Lists and Approver User List
    EXPORT PS_EOAWUSER_LIST WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LIST WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LIST WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LIST WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    
    EXPORT PS_EOAWUSER_LNG WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LNG WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LNG WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    EXPORT PS_EOAWUSER_LNG WHERE EOAWUSER_LIST_ID IN ('ZZ_EXP');
    
    -- Export Process Stage Path Step Definitions
    EXPORT PS_EOAW_IDS WHERE EOAWCOUNTERNAME IN ('ZZ_EXP_XREF');
    EXPORT PS_EOAW_PATH WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_PATH_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_PRCS WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_PRCS_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_STAGE WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_STEP WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_STEP_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_STG_LNG WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TIMEOUT WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_TIMEOUTDEF WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_AUTH WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    EXPORT PS_EOAW_AUTH_DTL WHERE EOAWPRCS_ID IN ('ZZ_EXP');
    
    -- Export Criteria Related Definitions
    EXPORT PS_EOAWCRTA WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%');
    -- EXPORT PS_EOAWCRTA WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%2014-09-16%'); -- With Effective Date Criteria
    
    EXPORT PS_EOAWCRTA_LNG WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%');
    -- EXPORT PS_EOAWCRTA_LNG WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%2014-09-16%'); -- With Effective Date Criteria
    
    EXPORT PS_EOAWCRTA_REC WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%');
    -- EXPORT PS_EOAWCRTA_REC WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%2014-09-16%'); -- With Effective Date Criteria
    
    EXPORT PS_EOAWCRTA_RECLNG WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%');
    -- EXPORT PS_EOAWCRTA_RECLNG WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%2014-09-16%'); -- With Effective Date Criteria
    
    EXPORT PS_EOAWCRTA_VAL WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%');
    -- EXPORT PS_EOAWCRTA_VAL WHERE EOAWCRTA_ID LIKE ('%ZZ_EXP%2014-09-16%'); -- With Effective Date Criteria
    
    
    -- Export NEM (Notification and Escalations)
    EXPORT PS_EOAWNEM;
    EXPORT PS_EOAWNEM_EMAIL;
    EXPORT PS_EOAWNEM_EVENTS;
    
    -- Export EMC (Email Collaboration)
    -- EXPORT PS_EOAWEMCLTLN_LNG;
    -- EXPORT PS_EOAWEMC_LYT_HDR;
    -- EXPORT PS_EOAWEMC_LYT_LIN;
    -- EXPORT PS_EOAWEMC_MSGHDR;
    -- EXPORT PS_EOAWFIELD_LIST;
    -- EXPORT PS_EOAWFRMINPT_HDR;
    -- EXPORT PS_EOAWFRMINPT_LIN;
    -- EXPORT PS_EOAWXLAT_SYMBOL;
    
    -- Export EOAW HTML Email Approvals 
    -- EXPORT PS_EOAW_EML_CFG_DT WHERE EOAWPRCS_ID IN (' ');
    -- EXPORT PS_EOAW_EML_CFG_LN WHERE EOAWPRCS_ID IN (' ');
    -- EXPORT PS_EOAW_EML_TMPL WHERE EOAWPRCS_ID IN (' ');
    
    -- Export Workflow Generic Template 
    EXPORT PS_WL_TEMPLATE_GEN WHERE WL_TEMPLATE_ID LIKE 'ZZ_EXP%';
    EXPORT PS_WL_TEMPL_GEN_TK WHERE WL_TEMPLATE_ID LIKE 'ZZ_EXP%';
    
    -- Export Workflow Transaction Setup Tables
    EXPORT PS_EO_TRANSACTIONS WHERE TRANSACTION_NAME IN ('ZZ_EXP');
    EXPORT PS_HCM_EO_TXN WHERE TRANSACTION_NAME IN ('ZZ_EXP');
    
    -- Export Self Services Tables for Workflow Config with CI Setup
    EXPORT PS_WF_HR_TRANS WHERE TRANSACTION_NAME IN ('ZZ_EXP');
    EXPORT PS_WF_HR_TRANS_NOT WHERE TRANSACTION_NAME IN ('ZZ_EXP');
    EXPORT PS_SS_TRANS_CI_DTL WHERE TRANSACTION_NAME IN ('ZZ_EXP');

    Data Mover Import Script

    -- Approval Process Definitions AWE Migration
    -- Begin import
    -- Transaction Name:
    -- Export File Name : ZZ_EXP_EXPORT.dms
    -- Import File Name : ZZ_EXP_IMPORT.dms
    
    SET INPUT D:\awe_dms_data\ZZ_EXP.dat;
    SET LOG E:\awe_dms_data\ZZ_EXP_IMPORT.log;
    
    SET UPDATE_DUPS;
    IMPORT *;

    For  Import we are using UPDATE_DUPS  because  it will automatically updates the duplicate with new one. else data mover produce Unique Constraint Violation Error.

    Download Script

    ZZ_EXP_EXPORT

    ZZ_EXP_IMPORT

    Hope this helps 🙂