Tuesday, January 9, 2018

Invoke a code activity (Native Activity) and retrieve the results using code – Workflow Foundation 4.5

Introduction

We can create code activity as a part of workflow solutions using workflow foundation 4.5. In this post I will show how we can create a native code activity and access the results in asp.net controller. Native code activity

 

   //The string mentioned in NativeActivity is the resut type.  

     public sealed class MySampleNativeCode : NativeActivity     {

         // Define an activity input argument of type string

         public InArgument Name { get; set; }



         protected override void Execute(NativeActivityContext context)

         {

             var name = context.GetValue(Name);

             //Here we set the string value to the Result property in NativeCode

             context.SetValue(base.Result, "Hello from Native Code Activity " + name);



         }

     }
Invoke the code activity The code activity is invoked in asp.net web api controller.
 
 // GET: api/CustomerRegistration

         public string Get()

         {

             //Create a instance of the native code

             Activity wf = new MySampleNativeCode();



             //Define the input argumentes

             Dictionary arguments = new Dictionary();

             arguments.Add("Name", "Suhail");



             //Invoke the workflow

             IDictionary outputs = WorkflowInvoker.Invoke(wf, arguments);



             //Get the output value and assign to return string

             var returnString = outputs["Result"].ToString();



             return returnString;

         }

Conclusion

You can see the value in “returnString” which is returned from Native Code Activity.



Saturday, January 6, 2018

Cannot add .Net Standard 2.0 Class as .Net Type in Workflow Foundation Activity Designer projects in Visual Studio 2017

Introduction

I was working on Workflow Foundation 4.5 using Activity Designer Library template in Visual Studio 2017.

Problem Background

When I try to add a class library as input Type through Type Browser in Activity designer it shows an error as “The selected type could not be created” as shown in the image below.

clip_image001

I compared another machine with the latest update of Visual Studio which was working fine. The problem seems to be I didn’t have .Net framework 4.6.2 SDK and .Net framework 4.7 SDK installed.

clip_image003

Solution

I modified the Visual Studio as below using Visual Studio Installer.

clip_image005

Conclusion

You will can refer .Net Standard 2.0 projects and dlls in workflow foundation project templates and use without any issue.

Sunday, December 17, 2017

Sri Lanka IT Pro Forum Meetup – December 2017

I will be speaking at Sri Lanka IT Pro Forum Meetup – December 2017
Venue: Microsoft Sri Lanka
Date: 20th of December 2017
Time: 6pm
Title: Manage how people use your SharePoint Online

In this session, we will discuss some of the key features in SharePoint Online and Office 365 that leads to create a successive governance model and control how people use our site.
Event Url:
https://www.facebook.com/events/136164450403376/

Suhail Jamaldeen  Suhail Cloud 2


Updated On: 22nd of December 2017

Slides

Some Clicks from the event

Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (1)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (16)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (8)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (19)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (21)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (3)Sri Lanka IT Pro - Suhail Jamaldeen - Suhail Cloud (11)

You can see all the photos from below url: https://www.facebook.com/pg/Suhail.Cloud/photos/?tab=album&album_id=595324667494068

Saturday, December 9, 2017

Make password expire and force users to change them - Office 365

Introduction

One of my clients want his users’ to change their password every 45 days as a part of their company policy.

Solution

In Office 365 admin center, under setting select “Security & privacy”.

image

There under Password policy you can set the days by clicking on Edit.

image


Thursday, December 7, 2017

Prevent users from creating Team, Communication Sites from SharePoint Online home page

Introduction

Users can create SharePoint Online Team site or Communication site by clicking the “Create Site” icon in the SharePoint Online Home page.

image


Problem
Some of the organizations want to prevent users from creating sites from the home page.

Solution

  1. Go to SharePoint admin center
  2. Click on “Settings”
  3. Select “Hide the Create site command” under Site Creation

image

Click OK button form the bottom

Conclusion

Create site Icon is in visible.

image


Wednesday, November 29, 2017

Sri Lanka IT Pro Forum Meetup - November 2017

I will be speaking at Sri Lanka IT Pro Forum Meetup - November 2017
Venue: Microsoft Sri Lanka

Date: 30th of November 2017
Time: 6pm

Title: Manage how people use your SharePoint Online
Organizations create governance model in order to address set of policies, processes, roles, and responsibilities.
In this session, we will discuss some of the key features in SharePoint Online and Office 365 that leads to create a successive governance model and control how people use our site.
Event Url: https://www.facebook.com/events/556881601320154/
Suhail Jamaldeen  Suhail Cloud
Updated On: 30th November 2017
Due to heavy rain this meetup has been postponed to December. I will let you know the date and time once it is scheduled.
Updated On: 17th December 2017
The meetup is scheduled to held on 20th December 2017. Please find  the details here.








Monday, November 27, 2017

Kalmunai IT Hub Monthly Meetup and Expert Talks – November, 2017

I did the session for Kalmunai IT Hub monthly meetup and Expert Talks for the month of November
Title: Automate your business processes with Microsoft Flow and SharePoint Online
Date: 26th of November 2017
Time: 10 am to 12 pm
Venue: IDM Nations Campus, Addalaichenai
Event Url: https://www.facebook.com/events/837998646382348/


Kalmunai IT Hub, November

Slides


Some clicks during the event

Suhail Jamaldeen - Kalmunai IT Hub Novermber (1)Suhail Jamaldeen - Kalmunai IT Hub Novermber (7)Suhail Jamaldeen - Kalmunai IT Hub Novermber (12)Suhail Jamaldeen - Kalmunai IT Hub Novermber (13)Suhail Jamaldeen - Kalmunai IT Hub Novermber (19)Suhail Jamaldeen - Kalmunai IT Hub Novermber (23)

More Photos On: https://www.facebook.com/pg/Suhail.Cloud/photos/?tab=album&album_id=579101805783021