Modify the Due Date in a GP Process

Hello everybody,
I need to modify the Due Date on a given Process. All I have is the Process ID, that i get from a Parameter in my function... I got some code form several pages in the SAP Library, but i get an error in the line:
          IGPProcessInstance procesInst = rtm.getProcessInstance(proc, userContext);
In this line a GPEngineException is raised, Any help will be greatly appreciated!!!
This is the Code I have:
     IUser user = null;
     IGPStructure params = null;
//        Get current user
     try {
               IWDClientUser wdUser = WDClientUser.getCurrentUser();
               user = UMFactory.getUserFactory().getUserByLogonID(wdUser.getSAPUser().getName());
          //        obtain the Process template
               IGPProcess process =
               GPProcessFactory.getDesigntimeManager().getActiveTemplate(
          //        by specifying its ID
               processId,
          //        and the user accessing it
               user);
          //        obtain the Run Time Manager
               IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
          //        create a new, empty role assignment list
               IGPProcessRoleInstanceList roles = rtm.createProcesRoleInstanceList();
          //        get the number of roles required
               int rolenum = process.getRoleInfoCount();
          //        iterate over the required roles
               for (int i = 0; i < rolenum; i++) {
          //          add a new role assignment to the list
                roles.createProcessRoleInstance(
          //          by specifying the role's unique name
                process.getRoleInfo(i).getRoleName()).addUser(
          //          add the current user to every process role
                user);
          //          Here you see how to populate parameters with data.
          //          This example only works, if you initiate the "Time-Off process"
          //          that is delivered per default with the GP Framework.
          //          You find it in the gallery below "Examples".
          //          Otherwise no parameters are initialized.
          String proc = processId;  // Got it as a Parameter
          IGPUserContext userContext =  GPContextFactory.getContextManager().createUserContext(user);
                           /* En Exception is Raised in this line: */
          IGPProcessInstance procesInst = rtm.getProcessInstance(proc, userContext);
          Iterator notifs = (Iterator) procesInst.getNotificationInstanceEnumeration();
          IGPNotificationManager notifManager = GPProcessFactory.getNotificationManager();
          while(notifs.hasNext())
                  IGPNotificationInstance notif = (IGPNotificationInstance)notifs.next();
                  if(notif.isDueDateNotification())
                            IGPDeadline deadline = GPNotificationFactory.createDeadline(
                                                                                     IGPDeadline.DEADLINE_ABSOLUTE_POINT,
                                                                                     null,
                                                                                     0,
                                                                                     (java.sql.Date.valueOf("2008-02-29")).getTime());
                            notifManager.updateNotification(
                                                                 proc,
                                                                 notif.getActivityInstanceID(),
                                                                 notif.getNotificationID(),
                                                                 deadline);
                params = GPStructureFactory.getStructure(process.getInputParameters());
                if (process.getTitle().equals("Time-Off Process")){
                     IGPStructure struc = params.addStructure("Time_off_data.1");
                     struc.setAttributeValue("AbsenceTypeText", "Vacation");
                     struc.setAttributeValue("SimulationCode", 0);
                     struc.setAttributeValue("CompletionCode", 0);
                     struc.setAttributeValue("PaidFlag", true);
                params.setAttributeValue("data", java.sql.Date.valueOf("2008-02-28"));
          //          initiate the process template by passing the Process template
                rtm.startProcess(process,
          //          a name,
                "Process started by API ",
          //          a description,
                "This process has been started by an API",
          //          the initiating user
                user,
          //          the role assignment,
                roles,
          //          the initial parameters
                params,
          //          and the user actually executing this action
                user);
      } catch (WDUMException ex) {
      logger.traceThrowableT(Severity.ERROR,
      "Current user could not be resolved: ", ex);
      } catch (GPInvocationException ex) {
      logger.traceThrowableT(Severity.ERROR,
      "Exception raised when trying to start process: ", ex);
      } catch (GPEngineException ex) {
      logger.traceThrowableT(Severity.ERROR, "Exception raised when trying to start process: ", ex);     
     catch (UMException ex) {
     logger.traceThrowableT(Severity.ERROR,
     "Exception raised when trying to start process: ", ex);
Edited by: Francisco Perez on Mar 10, 2008 3:41 PM

Hello All,
You can change the deadline of a Due date notification of an process as given below:
           IGPRuntimeManager rtManager = GPProcessFactory.getRuntimeManager();     
           String process = executionContext.getProcessId();
           IUser admin =   UMFactory.getUserFactory().getUserByUniqueName("administrator");
           IGPUserContext userContext =  GPContextFactory.getContextManager().createUserContext(admin);
           IGPProcessInstance procesInst = rtManager.getProcessInstance(process,userContext);
           Iterator notifs = (Iterator) procesInst.getNotificationInstanceEnumeration();
           while(notifs.hasNext())
                IGPNotificationInstance notif = (IGPNotificationInstance)notifs.next();
                if(notif.isDueDateNotification())
                    IGPDeadline deadline = GPNotificationFactory.createDeadline( IGPDeadline.DEADLINE_ABSOLUTE_POINT,null,0,(new Date(108,2,1)).getTime());
                    notifManager.updateNotification(process,notif.getActivityInstanceID(),notif.getNotificationID(),deadline);

Similar Messages

  • AP PAYABLES- Not getting all the DUE DATE's in with split schedule payments

    Hello All,
    We have some issues with AP Data loading's into our DW from EBS 11.5.10 AP - PAYABLES.
    One of our customer is using split schedule and share payment into few payment. Our
    sql is not reading all the due dates for PAYABLES.
    We are using PAYMENT_NUM=1 from ap_payment_schedules_all table as condition to load the Data to avoid duplicate rows coming for Payables.
    Some hints: removing the "PAYMENT_NUM=1" from the where clause gives all the due_dates but then we have duplicate rows for Payables.
    Please help to modify our query so that it will work for split schedule payment.
    select
    inv.invoice_num,
    inv.doc_sequence_value,
    sob.currency_code,
    inv.invoice_date,
    'EH'||inv.vendor_id vendor_id,
    'EH'||inv.vendor_site_id vendor_site_id,
    ael.ae_line_number distribution_line_number,
    inv.invoice_currency_code,
    aeh.accounting_date,
    'EH'||ael.code_combination_id code_combination_id,
    nvl(ael.entered_dr,0)-nvl(ael.entered_cr,0) accounted,
    nvl(ael.accounted_dr,0)-nvl(ael.accounted_cr,0) amount,
    fuser.user_name,
    fuser2.user_name user_name2,
    inv.payment_status_flag,
    'PAYABLES' rowtype,
    inv.discount_amount_taken,
    inv.invoice_type_lookup_code invoice_type,
    inv.exchange_rate,
    inv.exchange_date,
    tax.name,
    inv.source,
    inv.attribute6 eflow_doc_id,
    sysdate transfer_date,
    sch.hold_flag,
    inv.cancelled_date,
    sch.due_date
    from
    ap.ap_invoices_all inv,
    apps.ap_ae_headers_all aeh,
    apps.ap_ae_lines_all ael,
    ap.ap_tax_codes_all tax,
    ap.ap_payment_schedules_all sch,
    gl.gl_sets_of_books sob,
    applsys.fnd_user fuser,
    applsys.fnd_user fuser2
    where
    aeh.ae_header_id=ael.ae_header_id and
    inv.set_of_books_id=sob.set_of_books_id and
    inv.invoice_id=sch.invoice_id and
    sch.payment_num*1=1 and ---------------------------------------------- *
    fuser.user_id=inv.last_updated_by and
    fuser2.user_id=inv.created_by and
    ael.tax_code_id=tax.tax_id(+) and
    ael.ae_line_type_code='LIABILITY' and
    inv.invoice_id=ael.source_id and
    ael.source_table='AP_INVOICES' and
    aeh.gl_transfer_flag='Y'
    Thanks,
    Aman

    Hello All,
    We have some issues with AP Data loading's into our DW from EBS 11.5.10 AP - PAYABLES.
    One of our customer is using split schedule and share payment into few payment. Our
    sql is not reading all the due dates for PAYABLES.
    We are using PAYMENT_NUM=1 from ap_payment_schedules_all table as condition to load the Data to avoid duplicate rows coming for Payables.
    Some hints: removing the "PAYMENT_NUM=1" from the where clause gives all the due_dates but then we have duplicate rows for Payables.
    Please help to modify our query so that it will work for split schedule payment.
    select
    inv.invoice_num,
    inv.doc_sequence_value,
    sob.currency_code,
    inv.invoice_date,
    'EH'||inv.vendor_id vendor_id,
    'EH'||inv.vendor_site_id vendor_site_id,
    ael.ae_line_number distribution_line_number,
    inv.invoice_currency_code,
    aeh.accounting_date,
    'EH'||ael.code_combination_id code_combination_id,
    nvl(ael.entered_dr,0)-nvl(ael.entered_cr,0) accounted,
    nvl(ael.accounted_dr,0)-nvl(ael.accounted_cr,0) amount,
    fuser.user_name,
    fuser2.user_name user_name2,
    inv.payment_status_flag,
    'PAYABLES' rowtype,
    inv.discount_amount_taken,
    inv.invoice_type_lookup_code invoice_type,
    inv.exchange_rate,
    inv.exchange_date,
    tax.name,
    inv.source,
    inv.attribute6 eflow_doc_id,
    sysdate transfer_date,
    sch.hold_flag,
    inv.cancelled_date,
    sch.due_date
    from
    ap.ap_invoices_all inv,
    apps.ap_ae_headers_all aeh,
    apps.ap_ae_lines_all ael,
    ap.ap_tax_codes_all tax,
    ap.ap_payment_schedules_all sch,
    gl.gl_sets_of_books sob,
    applsys.fnd_user fuser,
    applsys.fnd_user fuser2
    where
    aeh.ae_header_id=ael.ae_header_id and
    inv.set_of_books_id=sob.set_of_books_id and
    inv.invoice_id=sch.invoice_id and
    sch.payment_num*1=1 and ---------------------------------------------- *
    fuser.user_id=inv.last_updated_by and
    fuser2.user_id=inv.created_by and
    ael.tax_code_id=tax.tax_id(+) and
    ael.ae_line_type_code='LIABILITY' and
    inv.invoice_id=ael.source_id and
    ael.source_table='AP_INVOICES' and
    aeh.gl_transfer_flag='Y'
    Thanks,
    Aman

  • How to set SPD workflow to send email one day before the Due Date? ?

    I need to add a step in workflow for a item tracking list: send reminder email one day before the due date.
    I thought there is an Action in SPD: wait for [Due Date] to equal [Today]minus one day
    But there is no way to do that.
    I figured may be I need to create a calculated field [cal-date] that set to: =[today] plus one day.
    Then in workflow -
    wait till [Due Date] is equal to [cal-date], and send an email
    What is the formula for the above calculated field [Today] plus one day?

    Hi,
    You can add an approval action( such as Start Approval Process) -> click "Approval" -> go to “Change the behavior of a single task” . Then you will
    see the "When Task expires" stage.
    You can have a look at the blog:
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/5-Steps-to-Enhance-SharePoint-2010-Approval-Workflow.aspx 
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers
    if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Eric Tao
    TechNet Community Support

  • How to set the Due Date for action in GP

    Hi Experts,
    I am trying to set date for each and every action in GP. Please help me out for that. I have tried it through setting the due date in the action and in process also. But its not working. So, kindly give me step by step process.
    Steps which i have followed :
    1. Created an action
    2. selected Due date tab
    3. Unable to find the callable object to attach with the action.
    Can you please tell me where i am wrong?
    Regards,
    Nutan
    Edited by: nutan champia on Apr 1, 2008 11:25 AM

    Hi Experts,
    Please help me out.  I am using the Defining and configuring notification in the below mentioned link.
    http://help.sap.com/saphelp_nw70/helpdata/en/93/a45542f156be30e10000000a155106/frameset.htm.
    I am following the steps mentioned in the document but unable to proceed after selecting the Due date tab under the action/ process properties. Callable objects are not visible here. Whether I have to do some changes in the callable objects. Please guide.
    Regards,
    Nutan

  • How to send a mail prior to the due date

    Hi all,
                 I would like to send a mail prior to the due date. Please let me know how to go to the previous step after the loop is executed once in workflows.
    Thanks,
    Sirisha N.

    Hi all,
                 I would like to send a mail prior to the due date. Please let me know how to go to the previous step after the loop is executed once in workflows.
    Thanks,
    Sirisha N.

  • Payment Block removed or allow to make the payment after the due date

    Hi,
    Regarding Payment block, we have created one payment term with block indicator and assigned to some vendors. So each posting system will generate the entry with payment block, once the document crossed the due date (assume that 30days) system wants to allow to make the payment to the vendor without deleting or removing  the payment block. Is it possible.
    govind

    Hello,
    For this change, you need to develop a program and need to identify the age of 30 days invoices and remove payment block for those invoices. So 30 days aged invoices can clear.
    Logic: go to BSIK and find out ZFBDT of the document and deactivate the ZLSPR (Payment block).
    Or
    try to find out any functional module or user exit is available while clearing invoices. if available maintain the above logic.
    Regards,
    venkat

  • Cash discount calculated even after the due date in F110

    Hi Friends,
    Invoice and Credit memo is created with the reference to PO, but when the payment is made to the vendor through F110 the cash discount is calculated on the credit memo even though it has passed the due date.
    Let me know what else is remaining that has to be checked and corrected
    Regards
    Paddy

    Check the following configuration:  t-code FBZP -> All Company Codes -> double-click on the relevant company code to display the details. 
    In the "Cash discount and tolerances" section, I'm thinking that you'll find that the "Max.cash discount" check box is checked.  This check box tells F110 to always take the discount, even if the terms have expired.  If you uncheck the box, then F110 will only take the discount within terms.
    Regards,
    Shannon

  • Payment terms Payables - Can a discount period be longer than the Due Date

    My client regularly pays their supplier invoices beyond the due date but yet deducts the early payment discounts
    anyway
    I have tried unsuccessfully to create payment terms that would have the correct due date ex Net 30
    But would nevertheless calculate the discount they wish to take even beyond that due date
    For example try to set up a payment term 2% 60 Net 30
    But the discount is always canceled beyond the due date even if I set the discount period to go beyond the due date
    Now it is true they could still manually take it but the system would no longer calculate it for them
    The only way I think I can make this work is to make the due date period equal to the discount period
    So 2%60  Net 60
    Am I missing something here
    The client used to be able to do this automatically in his old Accpac dos system (take the discount anyway)
    Any comments would be appreciated
    Thank you
    Georges Ostiguy

    Hi Georges,
    the application considers the due date as the pertinent date & uses this date to calculate discounts, ageing reports etc.So this date cannot be used as 'merely advisory'. This is also the reason why this date is always the last date where the application allows an automatic discount calculation to.
    It is possible to manually change the due date of AP invoices & then adjust the 'Cash Discount Date Offset' field in the accounting tab of the document. This then allows an automatic re-calculation of the discount according to the payment terms & the updated due date.
    Since your customer uses the due date on the AP invoice received as an FYI only, you could let them enter this date in the BP Reference field on the document in addition to the actual vendor refenece number & then make that column visible in Step 6 of 9 in the payment wizard. Then maintain the actual due date as decided by your customer in the document & adjust the cash discount offset date.
    All the best,
    Kerstin

  • T.code FF7A: seeng a document by the due date ...

    Hi All,
    bY FB50 I've posted a bank loan for a certain bank G/L Account.
    Posting the document I've choosen:
    - the value date 26 semptember
    - the due date 31 october 2009
    When I launch t.code FF7A, the report show that document with reference to the value date.
    Instead, I need to see it with reference to the due date (31 october)
    Could anyone suggest me?
    Thanks

    Hi,
    Cash management reports that is liquidity forecast and cash position reports (FF7A and FF7B) is based on Value Date only.
    The report will not shown based on due date field but it is based on valued date.
    Value date is specifically useful only for Cash management reports that is it shows the inflow and outflow based on this date only.
    Hope this clarfies.
    Regards,
    Azeem

  • Baseline date not driving the due date

    My client is currently implementing ECC 6.
    In my past project, I had always thought that the baseline date drives the due date of a vendor invoice for example. But in transaction FB60, when i put in my baseline date, the due date gets calcualted using the payment terms. Is this correct? My client would like the baseline date to drive the due date for paying invoices. How can I correct this please?
    Thanks for your help.

    Hi,
    Yes, it is possible to overwrite the baseline date while making the posting in FB60. However, the payment terms is also taken into account for calculating due date. For example if payment terms id P30 - net due 30 days, the due date will be 30 days from baseline date.
    If baseline date is May 29th 2007, due date will be Jun 27th 2007
    If baseline date is changed to May 31st 2007, due date will change to Jun 30th 2007.
    Probably, you would like to increase or decrease the credit period days, which can done by changing the payment terms.
    Thanks
    Murali.

  • Send a reminder mail to a person in 'Assigned To' 7 days before the 'Due Date'

    I want to create a workflow on SharePoint list and it should send a notification email to 'Assigned To' person before 7 days of Due Date (another column in the list).
    I'm new to SharePoint. Please explain the steps in detail.
    Any suggestions would be greatly appreciated. Thank you.

    Hi Sekhar,
    Hope the below links should be useful to you.
    http://sharepoint713.blogspot.in/2011/09/sharepoint-designer-workflow-to-send.html
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/e85c2fcb-81fa-4c8d-9f0d-3c4799de771b/send-a-reminder-mail-5-days-before-and-1-day-before-the-due-date?forum=sharepointcustomizationlegacy
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/1e2912f4-3119-49b0-b620-e67f629596d0/how-to-send-alert-on-2-days-before-of-task-due-date?forum=sharepointcustomizationlegacy
    https://mysharepointchronicles.wordpress.com/2012/11/05/sharepoint-list-with-workflow-email-reminder-set-to-send-30-days-from-created-date/
    http://markeev.com/Articles/item-expiration-reminders-in-sharepoint-using-workflow.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Verizon moved the due date for returning my 400$ security deposit.

    A  year a go I came to the states and got a phone in Verizon. They made me leave a 400$ deposit in order to finish the deal. A year has passed now and they told me that the due date was moved recently to JULY of NEXT YEAR. I need this money back, this wasn't the deal I made with Verizon. Why did this happened? I need help. How do I get my money back? 

    even with electronic payment a payment could have came late.  Especially when the bank/credit system you use is down when Verizon tries and it fails.  Double check your billing to make sure that didn't occur at any point in time.  You could then see if you can get that fixed and see if they can move the date back to original if that's what indeed happened.

  • T.code F110 Created a proposal, could I modify the value date?

    Hi All,
    I need to create a proposal with tha value date successive to posting date....
    In particular, i wonder if, before running the payment i can modify the "value date" of the scheduled proposal  by hand.
    Thanks...
    Gandalf

    Hi Umberto,
    My understanding of your requirement is like this: When you make a payment to a vendor, it will be credited in his bank account say 2 days after the payment is generated in your system. Say if you have generated a payment document on 24th March, it will be credited to the vendor account on 26 th march. and you want to maintain the value date as 26th march in your payment document.
    If this is the requirement, maintain value date in FBZP settings, under bank determination, for the payment method/hosue bank and HB ID combination. You have to mention number of days to value date.
    Please let me know if this is your requirement

  • Debt outstanding which is 1-30 days past the due date

    hi
    how can i make this formula
    Debt outstanding which is 1-30 days past the due date
    i need use key figure debit restricted with variable range with net due date is like 1-30 days

    if i restricte debit with net due date will be fine

  • How to forbidden the appover to modify the plan data

    HI.
    I use a bottom-up planning session, After the planner enter the forcast data, he sends it to appover. My current requirment is to forbidden the appover to modify the forcast data that is entered by planner. But from STS, the appover can jump to the planner's input layout and modify it.
    Can any one give me some hint?
    Best Regards.
    Alex

    Hi
    You can use versions to differentiate between the data.
    Say planner at lower level, plans data with version W - working version
    When approver opens layout allow him to only see data with version W
    using comparison coloumns.
    but when he uses STS, use different layout altogether which uses say version
    E - edited version and he can plan on this data.
    E version layout should copy the data from version W on opening of layout.
    This would in turn mean lot of data records in the cube. But you might be able to achieve your requirement.
    Hope this helps.
    Thanks
    Vidya.

Maybe you are looking for

  • WEP works fine but WPA doesn't

    I'm using the WRT54G2 router and the WUSB54GC adapter, when I use WEP security the signal strength and connection is good, but when I try to use WPA, the connection keeps dropping and when it does connect, the signal strength is usually low to very l

  • TS3274 My ipad shows 4 updates for the apps but the ipad doesn't update

    IPad has 4 updates to do and the unit does not update.

  • HP vs17x monitor power light blinking

    After I bring my computer out of standby mode my vs17x monitor's power button/light blinks blue, with the sound of what I assume is power going to the speakers, and continues unless I hold it down to turn it off or unplug it. After some waiting and c

  • Problems with my Nokia 5800 XM... - Please Help!

    Hi, I have gotten my Nokia 5800 Express Music phone almost 1.5 months ago.  The problems which I am facing presently are as under: 1) The green key on my 5800 is not working in home screen.  When I press green key nothing happens.  It should open cal

  • Don't want to store temporary files in downloads folder firefox

    When opening an attachment from a website, such as a pdf, a windows pops up letting you choose to open with "Preview Document" or "save to...." If I choose "preview document," the pdf will automatically saved to my Downloads folder, which I don't wan