Pausing Workflow
Can someone tell me how to pause my workflow.
Senerio:
I have built a Request for Change workflow that allows a user submits a request for Change form, the workflow sends the form to a PM to determine if it is a project or not. Upon determination that it is a project, the workflow uses the v-cal component to send out meeting request to the appropriate stakeholders. I want to pause my workflow here until after the meeting with the stakeholders. After the meeting, i want the PM to be able to continue the workflow by click something???? and have the workflow send approval requests to the stakeholders.
Help, Please!
Filed under: Workflow Solution, Endpoint Management and Virtualization
Pausing a Workflow
I suspect what you are wanting to do would be best handled with standard Dialog Workflow "waits", but to summarize some of your options:
You can use the Pause Execution component for very short delays, e.g. less than a minute. This component does not stop execution of the web request, and is vulnerable to timeouts. The example given in the help is, "You may wish to pause the execution of an email system for a certain amount of time in order to give your SMTP server time to catch up with the demand. You may use this component to pause execution of your process for a number of milliseconds." I'm pretty sure this component is available in any project type.
Or, you could use Pause Execution Workflow component for longer-wait times. This component is only available in Workflow-type projects (you won't see it in a WebForms project, for example). This component will put the process into Exchange persistence, and then the Workflow monitoring process will retrieve it when the specified interval is up. The interval is defined in minutes. Because it is managed by the monitoring process, you can’t guarantee the exact interval. For example, if the monitoring process checks every minute, then it could get retrieved in 1 to 60 seconds. This component is powerful because you can dynamically or statically set how long the pause will be, or simply when to continue the process. For your specific example, you could dynamically set the ContinueDateTime pause method to "continue" the process the day after the stakeholder meeting (which is presumably a date that you will already have stored in a variable). There are many components in the Date Handling category where you could take your original date/time and, say, add one day or one hour to it.
You may find it easier, though, to just use the built-in capabilities of the Dialog Workflow component to handle what you are trying to do. Dialog Workflow components will basically "wait" for somebody to come back into the process and continue it, e.g. someone needs to come back in and approve a request. I believe this is similar to what you are trying to accomplish. Your first Dialog Workflow component could be the Request for Change form. The second Dialog Workflow brings the PM to a form where he/she determines if it's a project or not. Once that is determined, you send out the V-Cal meeting requests. Then your third Dialog Workflow could send out an email to the PM with a ResponsePageLink that takes him/her back to a form, and on that form, he/she can click "OK" on a form that states that the meeting occurred (and maybe adds some comments or something), and then the fourth Dialog Workflow can handle the approval requests of the stakeholders. This is a pretty common example of using the capabiliities of a Workflow project type to handle long-running, multi-step, stop-and-start processes.
If you need specific assistance with how to use Dialog Workflow components, etc. just write back.
Chris, You have been a lot of
Chris,
You have been a lot of help. You have now given me a couple of options to explore.
Question:
In recommendation two, using the vcal i can set static or dynamic start/end dates. If the PM want's to set a date/time on the fly, how can i capture the meeting end date variable to compare it against the "ContinueDateTime pause method to "continue" the process the day after the stakeholder meeting" ?
You have a few options
You can use the GetCurrentDate component to automatically "capture" the current date/time (yes, even though it's called GetCurrentDATE, it does also capture the time). So just put this component anywhere in the process to figure out dynamically what time it is at that exact moment. You can, of course, use this component multiple times in the same project...just give each of them a unique variable name if you want to differentiate them.
Or, if you want a human to manually choose a date/time from a web form, then you can use the DatePicker or DateTimePicker component to capture a date or a date/time respectively.
In my workflow, the PM
In my workflow, the PM determines that it is a project and clicks submit, then a follow up email is sent to the PM with the .vcs file attached so that the PM can schedule the meeting in outlook. The startdate and enddate are dynamic in the v-cal, but lets suppose that the PM gets the email and wants to schedule the meeting two or three weeks away. The meeting start dt and end dt is then going to be set within the outlook application.... so is there a way within Workflow to capture the end dt that the PM would be setting within outlook?
Not that I'm aware of
Maybe you can connect back into Exchange via web services or something to determine what date/time the request eventually was set for. Otherwise, I am not aware of a built-in way today to query Outlook calendar items from a Workflow. I believe there will be some interesting Outlook/Exchange components in the future to better schedule and query events in a way that is more direct than the vCal method. But those aren't out yet so in the meantime, you'll either want to check out the web services route, or configure your Workflow to let the PM choose the date/time from a web form and advise them not to change it in the .vcs.
Yea, i created another form
Yea, i created another form dialog that would require the PM to select the meeting startdate, enddate and meeting comments. I then captured these variables and passed them into the v-cal and like you said advise the PM not to change the date in the .vcs.
Again, thanks for the help.
I have questions about the
I have questions about the Pause Execution Workflow...
In configuring the 'Pause Execution Workflow', I am using the 'ContinueDateTime' method and the continue date time is using a dynamic model that has an 'Add Business Hours Component'.
Within the 'Add Business Hour Component'
When testing and waiting for the workflow to continue after the pause (10minutes after the Meeting ends) nothing happens. I am expecting the workflow to continue on to getting approvals from the stakeholders (which are the steps after the pause). Where am i going worng here?
One thought
When the PM sets the meeting end date, that date variable will also contain a time. So when you're testing this, do you know what time is associated with the date that you are choosing? You might want to display the date/time variable on an ASCII merge label for your own benefit so that you can see what exact date/time is getting chosen by the datepicker component. Maybe the time is not what you think it is, and therefore 10 minutes from that time is an unknown to you? Anyhow check that and let us know what you find...
I used the ASCII merge label
I used the ASCII merge label and the date/time is the same as the meeting date/time selected by the PM. I am sure that it is something that i am over looking.
Within the 'Add Business Hours' component, there is a field called 'Minimum Hours To Work' what is this and what should i set it to? I have also set the 'Business Time Span Config Usage' to 'UseGlobal'.
Here's an example which works
I'm not sure what isn't working in your project, but I was able to get a simple example working which I think does the same thing you're trying to do. I verified that it works both in the debugger and as a published project. I can't attach a .package file to this forum post, so I'll send you a message through the system and get it to you that way.
In the project, the initial screen asks for a date and time...just set the date and time to be a minute or two from now. Then, the project moves to the Pause Execution Workflow component, where it will "ContinueDateTime" 10 minutes after the date/time you set in the first dialog. The last thing the project will do will send an email after the pause...in the contents of the email, you will see the initial date/time and the date/time of the email, so that you can compare the two and make sure they're roughly 10 minutes apart. Of course, you'll need to change the Send Email to fit your environment, SMTP server, email addresses, etc.
If you determine what's different about your project than in my working example, please post back and let us all know...it's probably something simple.
Thanks Chris! I will check it
Thanks Chris! I will check it out and report back what i find out.
Imported and ran your example
Imported and ran your example and it worked great!! but.....
I used pretty much the same settings in my original workflow and did the exact same thing that you did in your example but my workflow will not continue after the 10 minute pause. I even deleted my original pause 'workflow execution' component and recreated it in my original Request for Change workflow, still no luck.
What component is it stuck on?
What component does your execution get stuck on...is it the Pause component, or does it move on after the 10 minutes and get stuck on the next one? And I'm assuming it just stays stuck forever? Also, are you running in the debugger or in a published project? Did you change your business timespan configuration at all?
It gets stuck at the Pause
It gets stuck at the Pause Workflow Execution Component. I have added components before the PWE and they execute as expected unitl it gets to the PWE and i have added the same comeponents after the PWE and nothing happens. I have changed the time from 10 minutes to 5 minutes to 15 minutes and waited for over an hour for something to happen. I am running this in a published project.
This should help ...
I had the same problem and worked with David King at Symantec. This is apparently a known issue but it hasn't been published in the KnowledgeBase as such yet.
The first workaround he gave me was to enable anonymous access to the AutoInvokeDelegateService.asmx and WorkflowManagementService.asmx in the project directory of the published project in IIS.
The second workaround he gave me was to do the following:
Under Start > All Programs > Altiris > Workflow Designer > Tools > Server Extensions Configuration, there is a section called Webservice Auto Invoke. There is a checkbox there for HTTP Authentication. If you check that, it gives you an option to select a username and password.
I believe if you specify a username and password that has rights to those two .asmx files that we discussed, you should be able to avoid leaving them anonymous.
----------------------------------------
I've never been able to get the 2nd workaround to work so I've been just enabling anonymous access to the AutoInvokeDelegateService.asmx and WorkflowManagementService.asmx files in IIS and my pause components have been working fine.
another thing to check
The solution in the last post is almost always the fix for this but there is a project level setting that can cause timeouts and escalations not to fire. On the Publishing tab of your project settings make sure Generate Hook for Auto Run is checked. Otherwise, AutoInvokeDelegateService.asmx does not get deployed and timeouts and escalations do not happen automatically.
I have made the recommended
I have made the recommended changes, as described by mazebru and rhammer , but still can't get passed the PWE component.
first try to manually run it
In IE, try to manually execute the CheckTimeoutsAndExcalations web method to make sure it gets processed.
From the Workflow machine browse to the WorkflowManagementService.asmx web service of you project and click CheckTimeoutsAndEscalations. From the next page click Invoke. Did your process go past the the PWE compoenent?
Results.... This is what i
Results....
This is what i get when i run manually
<?xml version="1.0" encoding="utf-8" ?>
<boolean xmlns="www.transparentlogic.com">false</boolean>
use the logging tool
Are you positive that you have workflows in process? Is it possible that and an error occurred after the pause?
You can run the logging tool to see what's happening. Start - All Programs - Altiris - Workflow Designer - Tools - Configuration and Logging Tool. On the First Tab (Current Running Processes) find Logicbase.ServerExtensions.exe and right click to set Logging Level to ALL. Do the same to your project which should also be in the list. About every minute you should see events that say something about checking timeouts and escalations. Look for errors (red lines) around that time. Make sure to set logging levels back to Error when you are finished.
Also, when you run a process to test record the tracking id. In WorkflowManagementService.asmx there is a method called GetCurrentWorkflowTasks. If the process is on a pause execution workflow component this method will return a task ID. You can then call the GetTriggersForWorkflowItem method using that task id to see when the WPE component should continue. If GetCurrentWorkflowTasks doesn't return anything then your workflow is probably complete..
I found out that my dynamic
I found out that my dynamic model within the PWE Component was not valid because i didn't have my mapping results wired up in the End component. I tested my Workflow and now i continues on to the next component after a 10 minute pause.
Thanks to all that chimed in to help me out with this.
Would you like to reply?
Login or Register to post your comment.