How to schedule a workflow for recurring executions: The solution

Scheduling a workflow for recurring execution has been long awaited in WFA, perhaps from 2.0 time. The following document shows how to get it done. I've also explained the logic behind it. It’s very simple to use, meets every requirement which one can have from a scheduler and of course highly flexible. Let's go!! The Real stuff. What is this? Is this actually a scheduler? No. This is actually a command in your workflow, but a special 'magical' command. This 'magical' command logic is built using the answers for the following questions: Can a workflow be scheduled for a delayed execution in a future time? Yes, but only one execution instance. If you want the next execution, execute the workflow again providing the same set of inputs and the execution date/time.During workflow execution, can a command inside a workflow get to know what is the  name of the workflow? YesDuring workflow execution, can the command know what is the job execution id? YesIs there any programmatic interface available to know what are the user input provided or a particular job execution? YesCan a command inside a workflow trigger another workflow? Yes.Can a command inside the same workflow trigger itself? Absolutely yes. I've ticked all boxes needed to build such a solution. The solution is to make the workflow a smart workflow, so smart that it can schedule itself for the next execution. It no longer needs any other task scheduler to tigger it. WFA provides a large set of REST APIs for other 3rd part SW integration. But I  also can make  good use of these APIs to make smart workflows. I have always believed that WFA should not only be seen as a framework for automating Storage boxes or server, but just about any task( inside a computer of course) which is done manually. WFA is an awesome product indeed.  So this is a command called "Workflow Scheduler" which  you can put in your workflow as another command. Prerequisites: You need PowerShell 3.0 on your WFA server. I certainly could have done it for PoSH2.0 as well, but life for web interfaces  using PowerShell is so much easier with Posh3.0. Posh3.0 is a big jump from 2.0. WFA is fully supported to work on Posh3.0. Its available by default in Win2012, Win2008 can be upgraded, Win2003 users can't use it. Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhost Match: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   3.  Minimum WFA version 2.2. This is only needed for Importing the dar. I've provided the command code in text too. The command code is the real deal. How to use it? If you have a workflow which you want for recurring executions, just add this command "Workflow Scheduler" in it. The command takes parameters for the workflow execution intervals. For example minsInterval for executing this workflow every x minutes, or daysInterval for executing the workflow etc.Now just like a normal workflow execution execute this workflow deciding what is the trigger time. Example: Suppose you want the execution every day at 10:00 PM.So provide daysInterval = 1 And execute the workflow for a delayed execution at 10:00 PM. You can pick the day to start as you wish. The workflow will execute at 10:00 PM and when this execution reaches our magical command "workflow scheduler", this command will trigger the same workflow  with same set of inputs for the next execution at 10:00 PM tomorrow. And so on an so forth. I’ve attached a very simple example workflow here to help you understand. An Example of a workflow scheduled for recurring execution Daily at 11:30 PM starting 10-March-2015     How to stop/suspend this recurring execution? Easy. You just abort the next scheduled job execution in Execution=> Execution Status. The cycle will stop. How to resume it? Easy again. Just resume the same aborted job. The cycle restarts. Can I change the schedule execution time? Yes. After aborting the current execution, you can resume the same workflow at a new time. Execution interval can't be modified as you can't change the command parameters. But the recurring execution now can occur at a new time. Where or which position to place this “workflow scheduler” command in your workflow? At the beginning ? At the end? Or somewhere in the middle. This completely depends on your choice. See some below cases. You don't want the next job execution scheduling to happen if any of the commands in my current workflow execution fails: Put command “workflow scheduler” in the end. It will trigger the schedule of the next job execution only when all real original commands of your workflow have passed. else not.     You want continuous job executions irrespective of the workflow command failures: Put it in the beginning. It will trigger the schedule for next execution before any of the actual command begin executing.     You want an approval before the next execution job is scheduled: Add an approval point before the comamnd.           So it’s all left to you.      Can an operator decide the execution schedule? Yes, but which workflows will be available to him/her for this recurring execution will have to be decided by the designer. This is a good thing to have as it serves for access control in a way. The Architect/Admin can now restrict which workflow can be put for recurring executions. Operators can’t execute just any workflow available to him for automatic recurring execution. And the workflow designer can also choose which scheduling parameter is to be made a variable for the operator. For example the designer want the operator to schedule a given workflow only for weeks Interval and not months or days i.e. he/she can only chose to schedule for weekly, biweekly etc. executions and  nothing else. For this the designer can define a User-Input variable only for weeksInterval parameter. It’s Done. You want workflow execution to be scheduled either for daily or once in 2 days but not any other. You can restrict this. Or he/she wants to give full freedom to the operator make his/her own decision about scheduling, he defined user-input variable for all scheduling parameters. The workflow designer wants weekly schedule but the day should not be a weekday: You can even do this. Is this flexible enough for my requirements? I’ve attached the very command code. You can modify the command as per your requirements. Suppose you want daily execution of a certain workflow at 10:00 PM but skip a day of execution if the day is a Monday. Modify the code check for the day and add another day if it’s a Monday. Its posh code and highly readable. So you can see how this can be used in a  variety of ways. This is the beauty of a programmatic solution. Its highly flexible, it allows users to design solution based on their requirements. Flexibility is the heart & soul of WFA. Thats why I like it. I have a workflow but I don't want to modify it by adding a new command in it. Can I still use this solution? Yes but with WFA 3.0 on wards. WFA3.0 allows to create modular workflows. Create a parent workflow with you actual workflow as a child workflow in it. Add our “workflow scheduler” command too. So now you don't need to touch your existing workflow. I've attached a workflow example here.   Have fun!! sinhaa  

Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

Similar Messages

  • How to trigger a workflow for DESADV when the IDOC reaches status 51

    Hi,
    A notification to the a user should be sent when DESADV goes to a error status 51.
    I'm in SAP6.0 :
    Basic type: DELVRY05
    Message type: DESADV
    Idoc: IDOCDESADV
    Event: inputErrorOccurred
    Task to be linked for the event : TS00008178
    In SWETYPV the event is active, still this event is not getting triggered when the Idoc goes to 51 status.
    What am I missing? Is there any configurations that I'm missing?
    Can anyone please help me to fix this?
    Thank you,
    Renu

    Hi Renu
    There is two way to find the task and workflow....
    In pftc tcode, you can check the task and where it is used by giving the task type as standard and task as 00008178.Display the task,then check where it is used.
    Another way is:
    1.Goto swdm tcode.
    2.Select the Object tab.
    3.Choose catagory as BOR object type and give the Object type as IDOCDESADV.
    4.Then it'll display the task which is refering the method of the IDOCDESADV object.
    5.Click on that task.It'll come to right window.Now select the where used icon...
    6.If there is any workflow,then It'll display the workflow template number,name,step, and client.
    Regards,
    Hemalatha

  • How to generate the User-Input XML Body for executing workflows via REST APIs: The Solution

    I see that executing a workflow via REST APIs requires lot of work to be done just to prepare the right User-input XML body. Any mistake and you have some major debugging to do. Larger the number of User-Inputs, the bigger is the problem.Life is so much easier at the WFA GUI with Display names and tooltip help for User Inputs which are very easy for reading and providing the right values. I don't have any such privileges when manually preparing the User-Input XML body.It’s been asked numerous times how to provide User-Input values for type table, or Query (Multi-Select) etc. These are complex User-Input types and has lots of scope for user mistakes.I can have User-input dependency at WFA GUI which allows me to make the right selection, but while preparing my XML body I need to take care of it myself.An operator is allowed to execute workflows, but the same Display names which help him make the right user-inputs, makes it impossible for him to prepare the user-input body xml. Display names can't be used in in XML body and he can't know the exact parameter names by looking at the Display names. So he need to always contact the Admins/Architects for this. And Architects/Admins can't be expected to keep providing User-Input XML body to operators every operator. How about if I could enter all the User-Input values in my workflow execution at WFA GUI, I can do a preview which passed to my satisfaction and then I can magically get the XML body for it which I can use to execute my workflow from REST APIs from any client. It could be so very much easy for me than building my User-Input XML body manually. This is exactly what I'm going to give you right now. You open the WFA in browser, Go to your workflow, Start execution, you input values from GUI reading carefully the display names, preview it to your satisfaction and then get the XML body. Assume your workflow is called “Workflow to Print a given Message”. It’s a simple workflow with only 1 user-input Displayed as "Message to Print" Prerequisites:  The following are the one-time prerequisites. You need PowerShell 3.0 on your WFA server.Import the attached Generate_Workflow_User_Input_Body_in_XML.dar in your WFA. It’s our magical command called "Generate Workflow User Input Body in XML"Add credentials of a WFA Admin/Architect in you WFA itself with Name/IP: localhostMatch: ExactType: OtherName/IP: localhostUsername: <WFA Admin/Architect Username>Password: <User Password>   Steps: Suppose you have a workflow called "Workflow to Print a given Message". You want to execute it from REST apis and need to prepare the user input XML body.  Select this workflow and clone it. The workflow clone is the exact copy of your original workflow word by word, input-by-input. It will open in Edit mode with name "Workflow to Print a given Message - copy".Add the command "Generate Workflow User Input Body in XML" at the beginning of your workflow. This is a must. This command need to be the first command in your cloned workflow.This command requires no input. So for its Parameters just press okay and save the workflow.You are done.Now Execute the clone workflow. You'll see all the user-inputs available to you. Make your choices as you wish. Preview it to confirm that planning is passed and u have no errors.Execute it now.You'll see that the our magical command "Generate Workflow User Input Body in XML" has failed in our clone workflow execution. Don't worry, its fate was decided to be so. But it didn't fail before giving me what I really wanted. i.e. my XML body for my real workflow. It displayed it in the GUI as well as saved it in your WFA server @ C:\temp\<workflow_name_dd_MM_yyyy_hh_mm_ss_.xmlIt also deleted all the reservations of this particular failed job. So NO major residue left to be cleaned.To summarize: Clone Your workflow and Add the command "Generate Workflow User Input Body in XML" as your first command.    Start Execution, provide your User-inputs and preview it. Be satisfied and Press Okay.   Now Execute it.  After a few scconds this cloned workflow will fail with Error "All done. The Workflow will fail now."     See the command execution logs for this command. You'll see the User-Input XML body. It has also saved the XML file at C:\temp in your WFA server.   Have fun. sinhaa  

    Providing a new version 1.1.0 of the command "WFA Schedular" Changes made: Added conditional String Representation based on the Scheduling parameter provided. Provided check for the right number of parameters passed into the command.Added a new parameter "Expiry Date" to automatically stop the recurring execution upon expiry.Check for Posh3.0 version in code.Have Fun!! sinhaa Below example for:Schedule a workflow for recurring execution every alternate day i.e. once in 2 days at 10:30 PM starting 06-Jul-2015 (Today's date is 02-Jul-2015) . The recurring workflow execution  should expire on 31-Dec-2015 and stop.  

  • Custom Workflow for Shipping Execution

    Hi All,
    We have a requirement to cater approval on issuance i.e. at the time of shipping execution. For this purpose we have used Oracle Workflow Builder to cater the requirement. The workflow is working fine for approval but not for rejection. If we approve the shipping execution, the transaction is working fine but if we rejects it, the shipping transaction got stuck with exception and if we resolve the exception manually, we are unable to re send it for approval or even shipping.
    I will be grateful if anyone can help me out and advise me on how to setup of workflow for rejection.
    Thanks in advance.
    Regards,
    Zulfiqar Ali Mughal

    It is possible that the workflow has already been registered in db before you modified workflowActivities.xml.Did you try cleaning up workflow tables and restart the server??
    epub_workflow_info, epub_coll_workflow, epub_ind_wf,epub_wf_server_id tables
    Make sure there is only one entry for each workflow in epub_workflow_info. If there are multiple entries, then it may be coming from 2 different places and you need to disable one of them. Whenever you create custom work flow, copy the existing workflow and modify it and give it a different name. If you are importing programmatically, you really dont need to configure it in taskConfiguraiton.xml ( as it corresponds to settings related to which item-descriptors, tabs, security in BCC gui).
    -karthik

  • How can I customize Workflow for Organizational Change (WS01000014)

    Hi ti all!
    Let me know please, How can I customize Workflow for Organizational Change (WS01000014)?
    What steps must I do?
    Thank!

    Oracle Workflow home page is basically static HTML content rendered by Mod PLSQL code written in WFA_HTML.HOME procedure. There is no supported way of customizing this page.
    Thanks

  • Error "No schedule line due for delivery upto the selected date"

    Hi Experts,
    I am getting an error while creating outbound delivery for sales order.All items have same item cat and schedule line category,same customer.
    The sales order have three items with delivery date of 18.09.2008.the material stock is available for all three material and there is no planned issue for these material.
    In sales order schedule lines for all three items is confirmed on 18.09.2008. When I create a delivery on 04.09.2008(before the chedule line),it allows to create delivery for the two items but when I create delivery for material 3 on 04.09.2008(before the chedule line),it is giving error "No schedule line due for delivery upto the selected date" .on going to help it gives information that check whether the order item to be delivered contains confirmed schedule line.I checked the confirmed schedule line is on 18.09.2008 (though we have availbe stock on 04.09.2008).
    Kindly guide me how to resolve the issue,here I want to create delivery prior to the delivery/Schedule line date in Sles order.for 2 items it works but for third it is giving error.
    Is it something to do with Material group 5 in material master sales view for the 1 and 2nd mtrl it is 14 days for for the third it is 7 days?
    Sarvesh
    Edited by: Sarvesh Vashist on Sep 5, 2008 5:31 AM

    Hi Experts,
    I am getting an error while creating outbound delivery for sales order.All items have same item cat and schedule line category,same customer.
    The sales order have three items with delivery date of 18.09.2008.the material stock is available for all three material and there is no planned issue for these material.
    In sales order schedule lines for all three items is confirmed on 18.09.2008. When I create a delivery on 04.09.2008(before the chedule line),it allows to create delivery for the two items but when I create delivery for material 3 on 04.09.2008(before the chedule line),it is giving error "No schedule line due for delivery upto the selected date" .on going to help it gives information that check whether the order item to be delivered contains confirmed schedule line.I checked the confirmed schedule line is on 18.09.2008 (though we have availbe stock on 04.09.2008).It allows to create a OBD either I change the delivery date in sales order to 04.09.2008 or create a delivery with delivery date 18.09.208.
    Kindly guide me how to resolve the issue,here I want to create delivery prior to the delivery/Schedule line date in Sles order.for 2 items it works but for third it is giving error.
    Is it something to do with Material group 5 in material master sales view for the 1 and 2nd mtrl it is 14 days for for the third it is 7 days?
    Sarvesh
    Edited by: Sarvesh Vashist on Sep 5, 2008 5:31 AM

  • I have an external hard drive that was formatted by a PC and has files and directories etc. I want to format it and use it on my IMAC for backup but I can't seem to write to it nor can I delete current content. How do I initialize it for use with the MAC?

    I have an external hard drive that was formatted by a PC and has files and directories copied to it etc. I want to use it on my IMAC for backup. I see it on my my IMAC . I can open files etc.  But I can't seem to write to it nor can I delete current content. I don't care if I lose current content. How do I initialize it for use with the MAC?

    You can't write to it because it's formatted as NTFS which OS X will read but not write to. If you want to continue using the drive with both a PC and OS X you will need to download and install NTFS-3G so you can then write to it from your Mac. You can get NTFS-3G at:
    http://www.macupdate.com/app/mac/24481/ntfs-3g
    If you want to use the drive exclusively with your Mac then move the data off it and reformat it in Disk Utility (Applications - Utilities - Disk Utilities) as Mac OS Extended (Journaled.)

  • How can you get audio for  books on the kindle

    how can you get audio for  books on the kindle

    The audio inputs on Macs are line level inputs and not mic inputs.  You need a mic with a built in preamp (battery powered) or more conveniently a USB mic or bluetooth headset.

  • How can I add keywords for SEO into the code?

    How can I add keywords (for SEO) into the code of a Muse designed site?

    You might also be interested in the upcoming MuseJam on Thursday Muse Jam: Search Engine Optimization | Facebook
    Muse Jam: Search Engine Optimization
    Online May 22, 2013
    Join Principal Product Manager Dani Beaumont of the Adobe Muse team as she explores ways within the Muse application to build search engine optimized sites by way of metadata, keywords, H1 definitions, and sitemap generation. After the presentation we'll open the floor to any questions you might with the application.

  • How can I purchase items for app when the app was loaded on another ID before? I has to Chang my AppleID and also transferred an app to new phone. I can't purchase items for app because it wants me to buy the app through new ID. The app was free.

    How can I purchase items for app when the app was loaded on another ID before? I has to Chang my AppleID and also transferred an app to new phone. I can't purchase items for app because it wants me to buy the app through new ID. The app was free.

    All apps (and other content from the store) are tied to the account that downloaded them, whether or not they are free. To do in-app purchases in that app you will either need to log in with the account that downloaded it, or delete it (which will delete its content) and download it with your currently logged in account if you want to do IAPs on that account.

  • How to schedule a job for transaction CG36, incl. variant?

    Hi all,
    When you enter transaction CG36, you need to select a User Exist (EHS_DXSDB). After that you need to define a file path.
    I would like to schedule a job for transaction: CG36 > Define User Exit: EHS_DXSDB (Import Dok-X material Safety Data Sheets) > and define a path. With transaction SE93, I found program name: RC1RIMPS (program is allowed to be job scheduled), only I can't create a Variant (to define the user exit and file path, no selectionscreen), how to create a variant?
    The following programs can't be scheduled either (as they are not of type 1 or J):
    SAPLC131
    SAPLC1EO
    SAPLC3G
    Thank you in advance!
    Kind regards,
    Roy Derks

    Hello Roy
    I am sorry. To my knowledge up to ECC 6.0 Enhancement Pack 4 there is no SAP EH&S process available there you can do what you are requesting. The "problem" is that you need to "answer" the user dialog. Therefore you can not generate/prepare a variant which could be processed as a job according to my knowledge.
    Therefore in my opinion you have this option only: prepare a copy of the transaction (or only the report) using either "Z" or "Y (customer reports). Then you need to exclude some line in the code (which gives rise to the user dialog) and prepare some customer specific coding so that the resulting report can be used in such a way that a variant is possible, but you must make sure that the process later (the real upload process) is processed too in this "job" queue. IN any case: you need to check the log of the report and this must be done by an user. Therefore an automatic process does have some "risks"
    The topic of import of reports is used in most cases during a set up of EH&S, because of mergers/acustions but not in the daily work with EH&S and there I believe that SAP does not support this demand.
    With best regards
    C.B.

  • How to schedule one report for multiple company code?

    How you can schedule reports in BW 3.5? Suppose I need to schedule one report for multiple company code, how can you do that and notify the users? I do not want to send multiple emails to the same user if the report runs for 20 times (for 20 different companies).
    points are given for ASAP replies.
    Thanks in advance
    Peter

    Dear Peter,
    Try to restrict the Company Code with  those 20 values and schedule.
    Regards,
    Ramkumar.

  • How to create custom workflow for document library?

    Hi All,
    I have a document library with a custom  people picker column "assign to". Need to create approval workflow using designer, approval must send to person who is selected in "assign to" column. I tried with designer workflow,But finally
    facing "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient". How to fix and achieve my scenario? Thanks in advance!

    I would suggest you to firstly print the assign to value using "Log to history" action. Moslty it could be of three reasons,
    1. Assign to value is not getting populated correctly in your SPD workflow
    2. Email server is not configured properly, If alerts and other emails are workfing in your server then this would not be a reason for issue
    3. The user your trying to send an email does not have valid email
    do let us know if can get the user email in your workflow.
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if the reply helps you

  • How to schedule offline backup for SAPDB or maxdb

    Hello,
    I have stand alone SAPDB server ( without SAp system) , I wanted to know how to schedule the OFFline backup for SAPDB.
    Can yo tell me the command to schedule the offline backup .
    Command should do like:
    1) bring the DB to admin mode.
    2) start offline backup .
    3) bring the db up after backup done
    Regards,

    Did you read the available documentation?
    > 1) bring the DB to admin mode.
    dbmcli -u control,<password> -d <database> db_admin
    > 2) start offline backup .
    dbmcli -u control,<password> -d <database> backup_start <medium>
    > 3) bring the db up after backup done
    dbmcli -u control,<password> -d <database> db_online
    Basically you can do the same when the database is online, all backups are consistent, there's no difference in "offline" or "online" backup as with other databases (e. g. Oracle).
    Markus

  • How to create a workflow for personnel data?

    Dear All,
                  I want to create a workflow for entering personnel data and submitting it to the immediate senior.I had created a workflow for leave approval.Can anyone tell me steps for creating the workflow for personnel data.
                               Pratighya Jain
    Message was edited by: Pratighya jain
            Pratighya Jain

    Check this documentaion on SAP Business Workflow, which is built in HR:
    http://help.sap.com/saphelp_46c/helpdata/en/a1/172437130e0d09e10000009b38f839/frameset.htm
    Things that can be done are eg:
    Application forms and everything for handling them
    Absence approvals, travel requests, expenses
    Time
    Pls don't forget to reward points and close the question if you find the answers useful.

Maybe you are looking for

  • Date format in PO printing.

    We developed a abap program, I copy the form MEDRUCK to a new form ZMEDRUCK, in ZMEDRUCK, I want to display the PO date and delivery date. All of these date is in format MM/DD/YYYY. Now the buyers want see the delivery date in the format DD.MMM.YYYY,

  • Hp pavilion x2 10

    Bought a hp pavilion x2 10 from harvey norman 2 weeks ago, and facing some issue now.  First would be the charging time, the charging time seems like taking longer than I expected. Left it charge overnight in sleeping mode, around 8-10 hours. The bat

  • I can't update anything in the app store. Can't update to mavericks or ANYTHING UGH

    All i get is this error : The operation couldn't be completed. (NSURLErrorDomain error -1012.)(-1012)

  • How do i delete a word document using shortcut?

    I have just bought a MacBook air & have installed Word etc onto the machine. I cant find how to delete documents in Word, it used to be easy!

  • Need Help for Nokia 6500 slide

    Hi all I'm A new Guy here , But I do really need help for hard reset my phone I already try *#7073# But It doesn't work , If Anybody know to make a hard reset please help