How to get notification of workflow errors? - dynamics-crm

I am having issues were a workflow is stalled because there is an issue with sending an email (send email activity). Typically, this is simply solved by resuming the workflow. I'm wondering if there any way to react to a workflow error, so the user knows they need to go in and resume the workflow.
I'm also wondering about this relative to a workflow that is attempting to assign a task to a user who no longer exists in the CRM or one that has an invalid email address, which I'm assuming would cause errors in workflows as well.
Any other suggestions related to this sort if issue would be welcome.
Thanks!

My point of view, is that monitoring can't be done inside CRM, because all CRM processes could be problematic (what happen if a workflow fails to monitor another workflow?)
The way I already done that, was by adding a SQL query (that check the workflow instance state) to a monitoring tool (such as Nagios with the check_mssql_health) or you can just create a small service that will send emails using SMTP.

Off the top of my head, I can't think of an automated way to do it (you could try attaching a workflow to a workflow instance record, but I'm not sure if that will do it).
I'd probably try to build a utility to query workflow instance records, and then notify users if necessary based on their status.

Related

Better way to do an alerting job in jenkins or alternative to do this

I need a better way to use my alerting code.Right now I have a code that check for space free on aws ecs and sends a simple notification to slack if space is less than 5gb using slack api.I used this code in jenkins and setup a periodic schedule to run every 15 min.But once the notification is triggered I wanted it to stop the check for 4 hours so, it won't fill the slack channel with messages .So, i used sleep 14400 after condition is triggered.But this leaves an executor of jenkins waiting.Is there a better way to do this?
If you really want a better way, you should use better tools. there are many tools (some free) out there, that can monitor something in a stateful manner (for example, using a daemon).
Writing to log (or slack channel) in this context of using Jenkins is sort of stateless, for example you cannot check whether an alarm is currently triggered or not.
Since you cannot check if an alarm is already triggered - using jenkins with the logic you requested in your question ('snooze feature') can be very ugly.
In general I would recommend using Conditional BuildStep to trigger a step if a condition is met (i.e. if alarm not already triggered), but since there is no way for you to poll this information, or achieve this with Jenkins without the solution being 'hackish' like creating a file to indicate alert is on, and deleting it from another job if it was created more than 4 hrs ago - I would suggest looking at tools more suitable for the job.

How to use While activity and Replicator Activity on Shareponit Workflows

I have developed a document approval workflow which I needed to use the Replicator Activity to solve the need for many people who can elaborate, review and Approve a document.
The workflow is performed on a sequence model as the state machine will not let me use the Replicator Activity.
For an idea of ​​the workflow I follow this example.
The problem is that I can't restart the workflow if someone rejects the document.
I was doing some tests using the While Activity to solve the problem but tasks are empty (Asigando to: is empty, title: is empty) for some issue generates error to the Replicator Activity.
Is there a known solution to this problem? or that otherwise could make the restart of my workflow.
You need to create an additional custom activity and put the contents of the replicator in the activity and add the activity to the replicator. When you are putting tasks directly in the replicator activity, they won't work somehow because they are having same tokens.
Also make sure you give different tasks different ids and tokens.
Thanks Paiman,
I appreciate your help.
I comment you that to provide a solution to my problem, I use the workflow of state machines and discard the initial idea of using Replicator Activity.
For the problem of assigning more than one task in the same state, ie if there is more than one user for the same state that it is for example the "revision of the document". for the first user after complete review task sends flow to the next state would be "document approval" before create a task to approval wonder if there is more than one user to the "state review" and if is true workflow return to the previous state which would be the Revision and create the new task and change the following user assign to review.

Security Role Issue in CRM 2011 for Workflow on Custom Entity

I have a custom entity in CRM 2011 which a user can create an instance of.
When that instance is created, a workflow is kicked off which emails a user asking them to approve the instance.
The user gets the email and goes to the form for the entity where they mark it as Approved.
The workflow at this point is waiting for the Approval decision to be made (which it now is) but something to do with the users security role is blocking the workflow from proceeding. The workflow remains in a "waiting" status for the Wait Until.
If I do the same steps again but as an admin, it works correctly.
What permissions does the approving user need in order to not break the workflow?
I gave them Create/Write/Read to the entity, and WriteActivity, ReadQueue but it's not working
Any assistance would be greatly appreciated!
I'm afraid all I can offer is suggestions here:
Is the workflow actually still waiting on the wait until? Or has it failed and is in a waiting state? See if there is an error in the in the section at the bottom of the system job.
Who is the workflow actually running as? - have a look at the system job - I believe it will be the permissions of that user which are important.
Consider the business units here as well as the actual permissions granted, e.g. is the record owned by someone in a different business unit from the workflow owner?
If there is a permission missing you might be able to see which one in the in the crm trace logs, have a look at the async log.
Try granting the user the following permissions: Execute Workflow Job, Read & Write on System Jobs, Read on Process (you can always take them away later, if you find they are not required)
Did you confirm that workflow is published Organization-wide? It doesn't sound like that should be causing the problem, but I have run into that before.

how to auto open an entity created in a workflow

I have run into a situation where I need to open a newly created quote at the end of a workflow. I have a feeling this is going to require me to create a a very simple custom workflow that uses "window.open", but I would like to avoid this if anyone has a better idea.
So I need to open a newly created quote as soon as it is created in a workflow. Anyone have any good ideas on how to do this?
Workflows are asynchronous; they run on the server (as opposed to the client) and do not run in realtime. eg a workflow that is triggered by creation of a record will run on the server sometime after the record is created (depending on system load etc - it could be a second or two, or could be half an hour later. If you have stopped the CRM Async service on the server, they might well never run.)
Because they run on the server the user has no interaction with them. As a result you can't open a window, as there's no user involved to open a window for...
What you probably want to do is make use of Dialogs (introduced in CRM 2011). You won't be able to use window.open() but as long as you've got a recent update rollup installed on the server you can present the user with a hyperlink to most CRM records.
Setup of Dialogs is much the same as Workflows, and they use the same mechanics under the hood. The difference is that they're syncronous (i.e. run in real-time) and they are client-side. There's some detail on Technet: http://technet.microsoft.com/en-us/library/gg334463.aspx

Scheduled Tasks/plugin on CRM 4.0

Is it possible to schedule pulgin on CRM.
I ‘m trying to create a reminder task activity for an opportunity entity if no there has been no activities in the last week. I would like this to run every week.
Thanks in Advance.
Though there is no such thing as a recurring workflow in Dynamics CRM, you can simulate this behaviour by creating a Workflow Rule that
Gets fired upon creation of the record
Checks a condition
Conditionally does something
Waits for n days/hours/minutes
Calls itself again
Don't forget to mark the rule as "Run as a child workflow".
I think perhaps a better approach would be to build that functionality into a workflow? I have not been doing much CRM lately, but I have implemented what you described, in Crm 1.2 back in the day. This turned out to be very useful for reporting as well, pulling reports of what sales staff makes it a habit to not follow up on opportunities.
Best Regards
Rihan
I would recommend to utilize SQL Server Scheduled Job. Although workflow can be used for this problem, but waiting-state-workflow is considered application consuming.
The reason is because the waiting-state-workflow is held in the memory, and it needs to be validated against certain timing condition periodically. In your case, it needs to periodically calculated whether it has exceed one week or not, and if it's yes, it will upload the waiting-state-workflow from the database to be executed.
Regards,
hadi

Resources