CRM Workflow and custom entity - workflow

I created a workflow for my custom entity which will notify me 2 weeks before the expiration date of my product.
I realised that not only the wait condition but even the "Send Email" not working.
When I am going to System Jobs show their status as "Waiting".
Any ideas guys?

Waiting status usually means your code is throwing an exception. Try to remote debug to the server.
This link might help too.

Related

Process stopped in unexpected step. Make sure that you defined all necessary connections

I'm having a problem with a Condition in a workflow:
The condition is:
Sending pages to Approval that match the condition are working as expected and moving to the Approve step:
However those that do not match the condition are getting stuck in the condition step and the email is not sent as expected:
I'm getting the following error on Event Log:
The connection is there and it's automatic, as you can see on the first image. Hence the question, anyone knows why this could be happening?
The "Send email to Jira" step is setup as follows (email redacted):
But I don't think it's even reaching it, as there's no other log entries for an email error, and the default emails from the workflow are indeed working as expected.
If user wants to move page from Condition workflow step, he must have a Manage workflow permissions.
However since your role (CMS Approvers) most probably do not have this permissions - workflow process stuck with the error message.
Although the error message is not very descriptive (we can definitely improve this part) this is the reason of your issue.
To solve it, please navigate to the Security section of the Condition workflow step and set Roles which can approve, reject and make changes
section to All except listed as you can see here: http://prntscr.com/pdtrgs
Also please double check that CMS Approvers role has Manage workflow permission.
Then it should work as expected.
I was able to recreate this issue in both Kentico 11.0.47 and Kentico 12.0.33. The strange thing about this is that an email does send if you reverse the steps. In other words, if the user is a global admin, then send an email. That works.
I'll need to ask the developers about this, and see if there is something we're both missing. Otherwise this looks like buggy behavior.
-Keith Hammond; Kentico Support

Your script, Email Studio, has recently failed to finish successfully

I'm getting a daily email from apps-scripts-notifications#google.com stating that
Your script, Email Studio, has recently failed to finish successfully. A summary of the failure(s) is shown below. To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.
I have no idea what this is, but it lists 24 errors (see below) every day. Any advice as to what the problem is, what I should do about it and how to stop the daily email alerts would be much appreciated.
Summary:
Error Message Count
Authorization is required to perform that action. 24
Start Function Error Message Trigger End
9/21/18 3:13 AM triggerEmailStudio Authorization is required to perform that action. time-based 9/21/18 3:13 AM
9/21/18 4:13 AM triggerEmailStudio Authorization is required to perform that action. time-based 9/21/18 4:13 AM
Etc etc...
Sincerely,
Google Apps Script
I had the same issue with specifically Email Studio. Going to https://www.google.com/script/start/, choosing Edit, and "All your triggers", allows you to delete the Email Studio trigger.

What to do if a RESTful api is only partly successful

In our design we have something of a paradox. We have a database of projects. Each project has a status. We have a REST api to change a project from “Ready” status to “Cleanup” status. Two things must happen.
update the status in the database
send out an email to the approvers
Currently RESTful api does 1, and if that is successful, do 2.
But sometimes the email fails to send. But since (1) is already committed, it is not possible to rollback.
I don't want to send the email prior to commit, because I want to make sure the commit is successful before sending the email.
I thought about undoing step 1, but that is very hard. The status change involves adding new records to the history table, so I need to delete them. And if another person make other changes concurrently, the undo might get messed up.
So what can I do? If (2) fails, should I return “200 OK” to the client?
Seems like the best option is to return “500 Server Error” with error message that says “The project status was changed. However, sending the email to the approvers failed. Please take appropriate action.”
Perhaps I should not try to do 1 + 2 in a single operation? But that just puts the burden on the client, which is worse!
Just some random thoughts:
You can have a notification sent status flag along with a datetime of submission. When an email is successful then it flips, if not then it stays. When changes are submitted then your code iterates through ALL unsent notifications and tries to send. No idea what backend db you are suing but I believe many have the functionality to send emails as well. You could have a scheduled Job (SQL Server Agent for MSSQL) that runs hourly and tries to send if the datetime of the submission is lapsed a certain amount or starts setting off alarms if it fails as well.
If ti is that insanely important then maybe you could integrate a third party service such as sendgrid to run as a backup sending mech. That of course would be more $$ though...
Traditionally I've always separated functions like this into a backend worker process that handles this kind of administrative tasking stuff across many different applications. Some notifications get sent out every morning. Some get sent out every 15 minutes. Some are weekly summaries. If I run into a crash and burn then I light up the event log and we are (lucky/unlucky) enough to have server monitoring tools that alert us on specified application events.

Team alert for build completion not firing

In TFS 2012, I've created a new Team, and then a new group that includes just me, and finally a new Team Alert that fires on build completion. I manually kick off a build and do not get any emails. Still trying to figure out if I can get alerts if I setup my own individual alerts. I know others are getting emails for code reviews so I suspect email settings are correct. Any tips appreciated.
Never mind. Problem sorted. I had the wrong email address in my TFS Profile.

How to Resume the Persisted Workflow with Delay Activity without Reloading into memory

How to Resume the Persisted Workflow with Delay Activity without Reloading into memory:
I am creating a workflow for leave application. My requirement is if any participant is not responded in the specified time, then the request needs to pass to next level participant approval.
Suppose a requester submitted a Leave Request and the Team Lead needs to approve it within 7 days. If the Team Lead is not responded in 7 days, then automatically it has to go to Manager Approval.
In general to achieve this, we will write a Windows service which is checking periodically and send the notifications once the period is elapsed.
But I want to achieve without writing the Windows service. Is there any possibility in WF4.0.
I am trying like this, once the requester is submitted the request then I am showing the request in the participant mail box and persisting the workflow. Once the participant responded I am resuming the workflow (because I am saving the workflow instance ID) and passing the participant response for further workflow execution.
In this if the participant is not responded, how to escalate / send the request to manager without using windows service.
Is it possible to do with anything with the Delay Activity?
If you create a workflow service it is hosted in the WoskflowServiceHost and this periodically checks is there are expired timers and resumes those.
You must host the workflow engine somewhere ...
If it's not in a windows service, it should be in IIS.
You can also host it in a "normal" command line application, but if you close the application the workflow will stop.