Leave workflow design - workflow-foundation-4

I am new to Workflows. Below is a sample application i am planning to develop using WF4 and ASP.NET
An employee will raise request for leave. This will be send to Manager
Manager will review it and approves or may ask for further clarification; then it will be redirected to employee.
HR will review and approves or may ask for further clarification; it will be again redirected to the employee
Below are few queries related to the App:
How can we go directly to a specific transition from ASP.NET in workflow
Scenario:
Manager approves..but HR denied. In this case employee will give some clarification and resubmits. In this case there is no need for Manager approval. So, we have to redirect directly to HR.
Question:
Is the requirement possible through WF4 using StateMachine in ASP.NET
Regards,

You may create two events "WaitingManagerApproval" and "WaitingHRApproval" to cater your scenario.

Related

Gsuite resources can't be shared with service account

I'm trying to fetch rooms (added from calendar.google.com) service account (created from https://console.cloud.google.com/iam-admin/serviceaccounts) in spring boot project.
I had one service account which I created 4-5 month ago, it was working and it is still working with the 3 specific rooms.
But if I add service account mail to other rooms, then these rooms are not returned in the project.
I did all the steps written here:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
https://support.google.com/a/answer/1034381?hl=en
Also, I tried removing the service account email from the room's "Share with specific people" list in Calendar, and then added it back (this helped sometimes in the past).
But the re-added room was also not returned in my project.
I'm using this method from java to get the rooms.
https://developers.google.com/calendar/v3/reference/calendarList/list
This look like a bug, so do you know how can I work around this?
If you shared the resource calendar with the Service Account through the UI, by adding the corresponding email in Settings and sharing > Share with specific people, the calendar might not have been added to the CalendarList.
In order to make sure that a calendar is added to the CalendarList of a Service Account, you should use the API and call calendarList.insert.
Update:
There are currently several open issues in Issue Tracker regarding Service Accounts in Calendar. The situation you are experiencing is most probably related to that: check this, this and this, for example.
Meanwhile, I don't think using the API can be avoided. Maybe you could develop some kind of UI to make it less painful?
I hope this is of any help.

Create opportunities in Marketo

I want to integrate Marketo api with my .net project.
My client has given a username & password to Marketo. I want to retrieve "opportunities" from Marketo. I have written code for that. Currently there are not any opportunities so I'm not able to test my code. Has anyone an idea how to create opportunities in Marketo so I can whetehr check my code is retrieving that records or not?
Opportunities are not visible as standalone entities in Marketo as they are in SFDC or other CRMs. Rather, as #joev said, you have to find a lead that has an opportunity and view the opportunity details within the context of that lead's detail view, on the Opportunity tab.
If you want to use the GUI to create an opportunity, the right place to do that would be in the CRM — not in Marketo.
You need to have create/update right via API, ask your client for create/update rights then you will be able to create some data through API itself.
Like other people have mentioned there isn't a direct GUI inside Marketo for creating opportunities. These are typically created via the CRM (aka Salesforce, NetSuite, Microsoft Dynamics, etc...) and then sync'd to Marketo.
If you want to test it and have no CRM available -- technically you can just use the REST API to sync your own opportunity to a lead. Once done you could login to Marketo to visually validate it. Then now that you have an opportunity created you could then use the API to GET the opportunities and further validate your integration.
Here is a link to Marketo's documentation on how to sync an opportunity to Marketo. Also on that page is the documentation on the other REST API options.

Workflow foundation 4.5 custom database for tracking

I am planning to use Windows Workflow Foundation 4.5.
I need to track information in a custom database.
Lists will be shown in a user interface (my tasks, all tasks).
What is the best way to have a generic system by which I don't need to add custom activities to a workflow.
workflow created
workflow ended
workflow terminated
receive activity started (log custom record in a table)
receive activity completed
--> bookmark events?? I also need to correlate an activity instance id with the record in the database.
...
Do I use a tracking participant for this or can I tap into the events of the workflow service host??
You don't need to add custom activities to your workflow. You can implement SQL tracking participant. Here is a sample: http://msdn.microsoft.com/en-us/library/ee622983.aspx
Tracking participant is the solution to choose here... it is really flexible. You can get the status of the workflow instance with the WorkflowInstanceRecord and the activity status with the ActivityStateRecord. Both records have the instanceId to correlate them.
Also you can track custom tracking in your code activities with the CustomTrackingRecord.
We are using it for long time and the performance is quite good.
I hope it helps.

Can workflow process be accomplished with asp.net?

We currently have workflow app built with infopath, sharepoint and bitztalk.
Basically, an empployee fills out a form, saves it and clicks "Forward to Manager"
His/her receives an email notification that a form is waiting in his/her queue to be completed.
Manager completes and forwards to next higher up.
The process continues until the final manager sign off and the process is now considered complete.
The cycle can begin again with new form.
The company hired a contractor to do this and is nowwhere to be found.
Unfortunately, we have no one inhouse with the knowledge to maintain this.
I have been asked to try and find out from you experts if it is possible to do this in asp.net.
If yes, can you please provide me with some links to get me started?
Many thanks in advance

Looking for guidance on WF4

We have a rather large document routing framework that's currently implemented in SharePoint (with a large set of cumbersome SP workflows), and it's running into the edge of what SP can do easily. It's slated for a rewrite into .NET
I've spent the past week or so reading and watching WF4 discussions and demonstrations to get an idea of WF4, because I think it's the right solution. I'm having difficulty envisioning how the system will be configured, though, so I need guidance on a few points from people with experience:
Let's say I have an approval that has to be made on a document. When the wf starts, it'll decide who should approve, and send that person an email notification. Inside the notification, the user would have an option to load an ASP.NET page to approve or reject. The workflow would then have to be resumed from the send email step. If I'm planning on running this as a WCF WF Service, how do I get back into the correct instance of the paused service? (considering I've configured AppFabric and persistence) I somewhat understand the idea of a correlation handle, but don't think it's meant for this case.
Logging and auditing will be key for this system. I see the AppFabric makes event logs of this data, but I haven't cracked the underlying database--is it simple to use for reporting, or should I create custom logging activities to put around my actions? From experience, which would you suggest?
Thanks for any guidance you can provide. I'm happy to give further examples if necessary.
To send messages to a specific workflow instance you need to set up message correlation between your different Receive activities. In order to do that you need some unique value as part of your message data.
The Appfabric logging works well but if you want to create custom a custom logging solution you don't need to add activities to your workflow. Instead you create a custom TrackingParticipant to do the work for you. How you store the data is then up to you.
Your scenario is very similar to the one I used for the Introduction to Workflow Services Hands On Lab in the Visual Studio 2010 Training Kit. I suggest you take a look at the hands on lab or the Windows Server AppFabric / Workflow Services Demo - Contoso HR sample code.

Resources