Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Workflow Tasks in sharepoint

Workflow Tasks in sharepoint

Scheduled Pinned Locked Moved IT & Infrastructure
sharepointdatabasesysadminsecurityhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    papy boom
    wrote on last edited by
    #1

    hi all, i wanna thank you for you contribution in all those forum and we know all that real knowledge is sharing so thank you again. here is my problem i want to make a job in sharepoint site who check all task in certain workflow i'll call him "sampleworkflow" i want to get task not completed in this "sampleworkflow" and impresionate a user called "goMan" to achieve this tasks. but first of all i must check all groups wich go man belong to and got this task who are assigned to those group. here is my code #region "Imports" using System.Globalization; using Microsoft.SharePoint; using Microsoft.Office.Server.UserProfiles; using System.Security.Principal; using Microsoft.Office.Server; using Microsoft.SharePoint.Workflow; using FileHelpers; using Microsoft.SharePoint.Utilities; using System.Collections; using System.Runtime.InteropServices; #endregion static class Module1 { public const string goMan = "Domain\\goMan"; public static void Main() { SPSite site = new SPSite("http://Site/"); List ListGroupgoMan = default(List); SPWeb web = site.AllWebs("http://Site/"); SPUser user = web.AllUsers(YesMan); impersonateValidUser("goMan", Result, "toto"); UpdateAllWorkflowTasks(site.RootWeb); Console.ReadKey(); } private static bool CheckUserInGroup(SPGroup Group, string name) { bool isInGoup = false; foreach (SPUser User in Group.Users) { if (User.Name.ToLower() == name.ToLower()) { isInGoup = true; break; // TODO: might not be correct. Was : Exit For } else { isInGoup = false; } } return isInGoup; } private static List GetGoManGroup(SPWeb web) { List ListGroup = new List(); foreach (SPGroup @group in web.SiteGroups) { if (CheckUserInGroup(@group, YesMan)) { ListGroup.Add(@group); } } Console.ReadLine(); return ListGroup; } #region "Workflow" public static void UpdateAllWorkflowTasks(SPWeb web) { var q = new SPSiteDataQuery(); q.Lists = ""; q.Query = "0x010801

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups