Windows Workflow Foundation 4 (WF4) Delay - windows

I'm working with the the Release Candidate of Visual Studio 2010 using Wf4 to write a new workflow for approving resource requests. In my workflow, I would like for a request to expire after a few days if no approval has been made for the request. We did this in WF 3.5 (Visual Studio 2008) by adding a Delay timer into an EventDrivenActivity parallel to the EventDrivenActivity that was awaiting an approver to come and approve the request. If the Delay expired before an approval was made, the EventDrivenActivity would terminate the request. Does anyone know if there is a similar mechanism for doing this in WF4?

In WF4 this is done in the same way using a Pick activity. A Pick has multiple PickBranch children, each with a Trigger and an Action. The Trigger for each is executed and will contain the Delay, Receive or whatever else you are waiting for. The Action than contains whatever needs to be executed. Only the Action associated with the first Trigger to complete is executed, the other triggers will be canceled and the other actions skipped.

Related

Power Automate: How will workflow know if item status changed while waiting for teams approval

So I have an SPFX application that is used to raise request, modify request, approve / reject. The usual request workflow. all these data are being saved in Azure SQL table. Now I have a workflow that runs on db item update trigger, it would start a teams "wait for approval" action and be sent to 2 approvers (1 for main and 1 for a backup approver, either of the two can approve and workflow would only wait for the first response). at the same time, approvers can also approve the request via the spfx app. they can approve it because the status of the request is "Pending Approval".
Now my issue is this: If the approver decides to approve the request from the SPFX app, db item's status would then change to Approve, However the request's teams approval is still "Requested"" in the teams.
I created a workaround for this by checking the request's status from the db so if the item is "Approved", doesn't matter what action the approver did in the teams approval, if the request is already approved or rejected in the db, the action made in the teams will not do anything.
BUT what if that backup approver, decides to reject the request. it would cause confusion because data would then be "Approved" in the database.
would it be possible to check the status, and then cancel the triggered teams approval for that request?
I hope I described the scenario well.

How do you get information on the transaction status in braintree asynchonously?

So when I submit a braintree order for settlement, there will/can be multiple state changes until I get my money. It can settle, stay in settling, get declined, and so on.
How can I get this information without having to call their API constantly? Is there some kind of webhook for that? Because in my tests, I only get updates for disbursements, which is (if I understood it correctly) basically the last step of the whole transaction.
There are webhooks for some events, but not for specifically when a transaction changes status.
You can, however, use the Search API to create a script or cron job that checks for status changes over a period of time.
If you have additional questions about webhooks or using the API, contact Support.

Is there a way to pause an execution of a workflow?

Is there a way to pauses and resumes a workflow programmatically through the REST API? For instance, I would like to be able to submit a personal time off request from an app, the app creates and triggers a workflow. The workflow sends a notification to the manager for approval and the workflow execution is paused while waiting for the manager's approval. Once the manager approves the request, it calls the workflow API to resumes the execution of the workflow.
From the documentation, there's an option to put the workflow to sleep and I can use it to periodically check for the request's status but this incurs additional cost because there's no idea when the manager is going to approve the request.
https://cloud.google.com/workflows/docs/reference/syntax
Update 2021-10-05:
Waiting for an HTTP callback is now supported:
- create_callback:
call: events.create_callback_endpoint
args:
http_callback_method: POST # can be GET, PUT, ...
result: callback_details
# Send the callback URL somewhere for another service to call
- await_callback:
call: events.await_callback
args:
callback: ${callback_details}
timeout: 1800 # optional, in seconds
result: callback_request
Original response
The ability to wait for an HTTP webhook callback during a workflow execution is planned. (I'm the Workflows PM.)
Until then, you're right that the best solution is to poll for a flag (Firestore works well for this) using sleep.
Not sure about your use-case, but I guess you can only choose to execute the workflow once the manager has approved.
As you know there are 2 parts the first part creates the workflow.
As it is in https://cloud.google.com/workflows/docs/reference/rest/v1beta/projects.locations.workflows/create api for example.
Or you can look at https://cloud.google.com/workflows/docs/creating-updating-workflow.
That does not execute the workflow it just creates it. So it can be executed at a later stage.
To execute the workflow, there is this Api https://cloud.google.com/workflows/docs/reference/executions/rest/v1beta/projects.locations.workflows.executions/create
OR see https://cloud.google.com/workflows/docs/executing-workflow
Also when executing the workflow you can pass in parameters if needed.
Then If I understand the pricing correctly from https://cloud.google.com/workflows#section-9 it seems they only charge you per step executed.
Sorry, I have been through those docs a fair amount I did not see an "option to put the workflow to sleep", Could you link those docs by any chance?
We are talking about two separate workflows here. There is no reason to engineer with pause or not.
Initiate and go up until you fire the approval process.
After approval, trigger a new workflow that does the rest of the steps.

Dynamics Custom Action Process Session

I am working with a test action that when activated and called via javascript will fire an email message. I used an action because I wanted to pass in some values to be used in the process. In a traditional workflow I could see the history of each time the workflow was fired.
Is there a way to see all of the times my custom action fired?
Traditional workflow are Asynchronous. What you are seeing as Process Sessions are actually Async Execution logs. Those are not available/applicable for Sync jobs like Realtime workflows or Actions. Maybe you can keep the failure logs in Action.
Unfortunately you have to assume from the Emails that sent out is Action execution time.

Send email notification when someone logs case activity

Our company wants to know when the case activity is 75% of the original estimated hours.
However, I think that might be a bit of a tough call.
So, can someone explain how to send an email notification from Microsoft Dynamics CRM when someone logs any kind of "case activity" against a case? I am happy to use .NET code if necessary.
Create a workflow against the 'case activity' entities, add a condition to the workflow to only send an email when the the 'case activity' is related to a case. E.g. regarding case contains data.
I would prefer a Plugin for this kind of thing because you can do a lot more within a Plugin's context.
This is what I would imagine:
Whenever an activity record is created/modified/deleted; if it is regarding a case, the plugin will execute:
Get all regarding activities for the case
Sum up the Duration
If the Duration Total is 75% of the Case Estimate then fire a
workflow
The workflow will then be configured to send an email. By combining the plugin with a workflow, you allow the email to be configurable if the wording/recipients/from needs to change in the future.
I would probably also pass in the 75% as a configuration setting to the plugin so that this is also semi-configurable (doesn't involve code - but you'd need to modify the plugin registration).
The plugin would need to cater for
New Activities being added
Existing Activities being edited (Duration and/or State changes)
At first I thought you would also need to handle Deletes, but that would drop the Duration below the 75% so you wouldn't need to send an email.

Resources