I am trying to replicate the activity "Assign a task" by building a "Workflow Custom Activity" that does the same but with some customizations I need for my requirements, the only problem I have encounter so far is that if the workflow is being canceled or the activity is being canceled (by going out from a parallel block without finishing), the "Assign a task" activity sends a notification email saying that the task is canceled, I would like to do that as well in my custom activity but I do not find a way to capture the "cancel event" in order to send the email in my custom activity.
I have tried the following:
Create an event receiver: I haven't find in "Workflow events" an event to capture cancel event.
Using the activity "WaitForCustomEvent": I do not find over the internet what is the name of the activity cancelation event to capture it in here.
Try/catch block: I have seen that the workflow is "Terminated" it finished with the following exception: System.Activities.Statements.WorkflowTerminatedException, however if I tried to capture that in the activity it do not compile. I've tried with ust System.Exception, but it doesn't go to the Catch block, also when the workflow is canceled I do not see that it thrown any exception.
I'm building the Workflow Custom Activity in Visual Studio 2017 for SharePoint 2013.
Thank you in advance.
Related
I am looking to perform a custom action when a content editor in Kentico 10 updates a page and it eventually gets published.
To be more specific we have a custom page type for products which also as an "Updated" checkbox allowing the editor to mark it as updated. When this happens (gets marked as updated) I would like to send an email out to users that have a registered interest in this product that it has been updated.
I was looking through the documentation and came across Global Events here: https://docs.kentico.com/k10/custom-development/handling-global-events/reference-global-system-events#Reference-Globalsystemevents-DocumentEvents
I was wondering if using global events to intercept the save action when the editor updates the product is the way to go here or if there is a better approach.
Kentico does n't have this functionality out of the box, but we can achieve this by writing Custom code for Global Event and a scheduler (if No.of mails is large)
Recommended steps:
Attach custom code to Global event handler while publish specific document publish after event
public override void Init()
{
// Assigns custom handlers to the appropriate events
WorkflowEvents.Publish.After += new EventHandler(DocumentPublishCustomEvent);
}
In the custom code, if required page is published then make entries into custom table for email to be sent [This step is optional you can send mail from custom event handler directly if only few mails to be sent]
3.Implement custom scheduler to pick the user info from custom table and send email to user.
Note: Ideally you can use email Template for send emails
Using Global events is one way of doing this, another way would be to use Kentico's Advanced workflow engine (If you have the EMS license):
https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-workflows/designing-advanced-workflows
You could create a custom workflow step and action which the editors would put the page into and which would send emails to interested people - https://docs.kentico.com/k10/managing-website-content/configuring-the-environment-for-content-editors/configuring-workflows/designing-advanced-workflows/creating-custom-action-workflow-steps
If you do not have the EMS License, using Global events seems like the way to go, but I don't see the updated flag field as necessary, you could easily check in the global event handler if the product arrived at the "Published" workflow step in the basic workflow and then send the email to the interested parties.
I have a blueprism process which attaches to a web page and performs various actions. The process has been running smoothly for six months, but I am now getting an initial error of "ERROR: Internal : AMI error occurred in WaitStart Stage 'Wait For Detail' on page 'Update Claim' - External AppMan reader thread exited before response from query"
After this Blueprism is unable to perform any online action. I get a message saying that the "Read Thread Is No Longer Alive"
It appears to be caused by the Accessibility and UI identification methods in the App Modeller.
Issue was caused by Microsoft pushing out an update to Sharepoint.
Blueprism are aware of the issue and have put a post up notifying users https://help.blueprism.com/Automation-Design/Application-Integration/Active-Accessibility-Spy-Mode/1280268672/Why-does-Active-Accessibility-crash-Blue-Prism-when-spying-SharePoint.htm
I re-engineered logic to use HTML elements. I found that the focus action performed the same as a global mouse click center.
I am currently trying to set the webhook (for visualStudio.com). I managed to to make the event 'Work item commented' work.
Now i try to set up the event 'Work item updated'. when i create the hook, the test is successfull (captured with http://requestb.in/). I save the webhook then go to edit any issue (I've selected all work item type and all fields) but i doesnt trigger the webhook. (no errors, just no webhook sent...)
Is there something special that need to be actived to make the work item updated trigger active?
Thank you
This is due to the Visual Studio Team Service issue, Microsoft is working on a deployment for this. Refer to this link for details: ServiceHooks notification issues with Visual Studio Team Services - 1/27 - Mitigating
Seeing if anyone else has had this problem and a resolution to it.
I have a visual studio sequential workflow on a list (not a library) which does NOT use tasks, the approval process is done through the Approve/Reject OOTB buttons on the list item. The approval is a 2 stage approval, whereby if the 1st stage is completed (via clicking the Approve OOTB button), i reset the ModerationInformation.Status from Approved back to pending then send an email to the 2nd stage approver.
My problem is, when i set the the ModerationInformation.Status back to Pending from Approved so there is never an approved version, the Creator loses permissions to view the item, and i get the "cannot find item" error from SharePoint for the person who created the item. The 1st and 2nd level approvers and anyone with approve rights CAN still see the item.
Some more background information. the code i am using to update the moderationinformation is
I get the properties from the workflow event and get a hook into the listitem
properties.Item.ModerationInformation.Status = SPModerationStatusType.Pending;
properties.Item.Update();
can anyone help.
Try using properties.Item.SystemUpdate(); this prevents SHarePoint from triggering any attached EventReceivers etc. I've had the same thing happen also. IMHO this is related to the fact that the item goes into update mode, then SharePoint basically has taken control over the item (seeing as workflows are usually run as the System account) but still sends you back to the the return url (i.e. the EditItem page of the list).
Since SharePoint is probably still doing work on the item (and when you use item.Update() it goes through all events etc. etc.) you cannot open it anymore, because you are not the system account.
When SharePoint finishes (after sent the emails etc.) the item is accessible by users again.
Like I said, I had the same thing happen during long running (i.e. longer than 2 to 3 seconds) EventReceivers / Workflows.
I have a workflow running on a forms list. The workflow has an OnWorkflowItemChanged activity sitting within a While activity. I know that the workflow enters the While loop and checks the while condition that has the value 'true', but it does not enter into the OnWorkflowItemChanged activity to execute its code. Once it enters the while activity it stop the workflow execution and sets the workflow status as 'Completed' in spite the fact that after the while activity there are several more activities.
What could cause the workflow completion when it reaches the onWorkflowItemChanged activity???
If there are any unhandled exceptions in your activity, the workflow will move to complete status. Please debug your code and see if you can handle the exception.
Thanks!