SP2013 Workflow Suspend - workflow-foundation-4

I am facing issue with work flow where Workflow goes to Suspend mode.
It is SP2013 Custom Workflow developed using Visual Studio 2012.Objective of the Custom workflow: User fills the form and submit, list get updated and workflow will initiate and go for the process.
Issue: After the deployment of WF, for first time when user is filling the form and submit, list is getting updated. But the Workflow Goes to "Suspend" mode. (
This Custom Workflow has a configuration file where we are providing other details including ID of Impersonator (farm is running under Claim Based Authentication).
Work flow works fine once when the Impersonator initiate the workflow (Fill the form and submit for approval) and everything works fine after that.

Click on the information icon next to the Suspended status. The error message should be listed there. If it is sitting in a suspended state saying Activity in Progress, this is usually an issue with the certificate chain between SharePoint and the Workflow Server.

Related

How do I manually sync a Mesibo profile with latest changes from server if that user published its data with LAZY mode?

I made a page where users can update their names and status just like WhatsApp & Telegram.
These changes are published using LAZY mode since I don't want to update every user using the app right away. I just want to fetch it manually when necessary (for example when the user open the chat view with that user). (https://mesibo.com/documentation/api/real-time-api/profiles/#profile-publishing-mode)
The problem is: how can I fetch the updated profile of other users?
Whenever I get the profiles with Mesibo.getProfile("address") the data is still not updated.
since I don't want to update every user using the app right away.
Even if you use real-time mode, updates don't go to every user but only those users who have subscribed to it.
https://mesibo.com/documentation/api/real-time-api/profiles/#subscribing-to-a-profile
In lazy mode, it may be updated along with other profiles or when the message is received from the users. Before that, getProfile may not return the latest profile.
If you are starting with mesibo, recommend using real-time mode and optimizing later using the lazy mode

How to run a job in ASP.NET MVC?

I'm writing an application ASP.NET MVC. I have some people records that expire after 2 year (their Status field changes to expired). I need to run a check daily to check for expired records. I do not have permission to create a job on the database, so i need to find a way to do it on my application.
Is there something equivalent to the database job or a workaround to let this run daily without any user intervention and without blocking the application ?
Please take a look at Quartz. I've used it in several projects to solve these kind of problems.
http://www.quartz-scheduler.net/
Nice article about Background Jobs in ASP.NET
http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx
I really like HANGFIRE. Which is really easy to use and has nice front end for managing tasks.
You must be logged on as an administrator to perform these steps. If you aren't logged on as an administrator, you can only change settings that apply to your user account.
If you use a specific program on a regular basis, you can use the Task Scheduler wizard to create a task that opens the program for you automatically according to the schedule you choose.
Open Task Scheduler by clicking the Start button , clicking Control Panel, clicking System and Security, clicking Administrative Tools, and then double-clicking Task Scheduler. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
Click the Action menu, and then click Create Basic Task.
Type a name for the task and an optional description, and then click Next.
Do one of the following:
• To select a schedule based on the calendar, click Daily, Weekly, Monthly, or One time, click Next; specify the schedule you want to use, and then click Next.
• To select a schedule based on common recurring events, click When the computer starts or When I log on, and then click Next.
• To select a schedule based on specific events, click When a specific event is logged, click Next; specify the event log and other information using the drop-down lists, and then click Next.
To schedule a program to start automatically, click Start a program, and then click Next.
Click Browse to find the program you want to start, and then click Next.
Click Finish.
Reference

how to hide a complete asp.net webform

I want a page to run in the background in my Asp .Net web application.
That page should not be visible to the user.
The exact use of this page: the user will schedule a mail, that is to be send later. After he scheduled, the page should be hidden.
Can we do it?
Platform version (.NET 4)
What you really want is a service.
However, there are several kludgy ways to do back ground tasks with asp.net
http://www.codeproject.com/Articles/12117/Simulate-a-Windows-Service-using-ASP-NET-to-run-sc
http://www.west-wind.com/weblog/posts/2007/May/10/Forcing-an-ASPNET-Application-to-stay-alive
http://www.mikesdotnetting.com/Article/129/Simple-task-Scheduling-using-Global.asax
If the user closes the browser before your scheduled event has occurred, it will never take place.
You really want a backend service that processed queued events. When the user schedules an email it adds it to the queue and then gets picked up and processed by the backend service.
http://quartznet.sourceforge.net/ is one option for it, or you could build a window's service and the queue manually.
Alternatively you could look into a service bus approach such as http://www.nservicebus.com/ which is backed by MSMQ.

Run job on ASP.NET website service start in IIS

I have some method that is invoked on Application_Start. And it starts on first page request by any user.
But i have another application, dependent on that task that fires during Application_Start.
So that if IIS/website is restarted- another application cant get some data from website, until someone requests page on the running website.
Is there a way to run some task on website start; without any interaction from user side, just to start website in IIS and do the job i want?
PS more details on implementation architecture:
Website starts an instance of messaging service and starts sending messages through that service(that is located on another server). I know that it would have been better to create wcf or windows service for this kind of things, but someone wrote this website before i was included in this project. So clients(that receive messages from messaging server) do not know anything about website. Here website is just administrative panel to turn on/off some messaging features.
My Solution
Created windows service for my task. Works well, under local system account has no problems with writing to windows event logs.
Check out this "The Dangers of Implementing Recurring Background Tasks In ASP.NET"
Also you should consider installing Quartz.NET as a service, so that you can setup scheduled tasks remotely.
You can try this.
Put an entry in your code into event log
Use the windows task scheduler to create a task
Create a trigger as "Begin the task On an event"
Create the action with the job you want

Workflow 4 with ASPNET: concurrency and status checking

I'm trying to model a request submission/ approval /completion scenario. I'm using a flowchart workflow hosted as a service in a console app using WorkflowServiceHost. The workflow has a service reference to a WCF Service hosted in IIS this second service interacts with the application database. I have an aspnet front end with a service reference to the hosted workflow service and call its methods from a proxy client.
The workflow is using a persistence database that I have created using the scripts provided.
The scenario is that a request for a service is made by a user. The request must be approved once by a specific person (I'm using a pick with a delay in one branch to remind the person if no decision arrives, the other branch is receive decision). For some services the request must have a second approval which can be done by any one of a pool of approvers. Once approval is all finished the request goes to a different pool of people for completion.
I have it working but 3 questions:
In the aspnet home page I have a list of requests with links to pages to approve/complete as appropriate and call methods on the proxy after which they redirect back but because it's all asynchronous I am having to manually refresh the home page to see the changed list. Am I stuck with forcing the page to refresh itself every x seconds to get around this or is there a way to make it synchronous/check state of workflow/wait for a message back? It's not terribly interactive just hitting a button and not knowing whether the action succeeded or not.
Is there a way to stop someone approving a request just after someone else in the pool has approved it? At the moment nothing happens for the second person when they hit the button (which is good). In the workflow persistence database I can see that the blocking bookmark is the next activity along (presumably set by the person who got there first) so it looks as though the second receive just doesn't happen. I have concurrency checking code in the WCF data service but this never fires because there is no attempt to update the database. I would like to be able to warn the second person that another user got there first.
My homepage list in the web app is built by querying the application database, but is it possible to query the workflow to find the status of each item, passing the item's id (I'm using the id as the correlation handle)? Is it normal to do this or do people usually just query the application database?
I guess you could create an Ajax call that would check if any state change occurs and only refresh the page when that is the case.
If you send a WCF request for an operation that is no longer valid you should receive an error, unless you are using one way messaging because there is no message to send the error back. Mind you that due to a bug in WF4 the message could be a timeout after 60 seconds. There is no real way to avoid the problem because you are checking the workflow state as persisted and letting the user do an action based on that. Even when you query the state the workflow could have been resumes but not saved yet.
Either can work but I normally query the workflow instance store as that is the closest to the actual workflow state.

Resources