SharePoint Designer — Custom virkni til að framkvæma notandi-útskýra C # virka

UPDATE: Þetta hefur verið gefið út til Codeplex hér: http://www.codeplex.com/spdwfextensions

UPDATE: Sjá hér fyrir nýjustu útgáfuna: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!381.entry

UPDATE: Sjá hér fyrir hugsunum mínum á commercializing þetta verkefni: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!569.entry

This project provides a custom activity in SharePoint Designer. Use this custom activity to invoke (senda) any C# function that you incorporated into the linked assembly.

Eins lok október, 2007, this is just an initial version of the project. I plan to expand it with a number of additional functions, including substring, Vísitala, replace, invoking web services and anything that seems useful or interesting. I also plan to post this to codeplex once I have my act together on that front. This will also be deployable as a solution at some point.

If you have any comments, spurningar eða ábendingar, vinsamlegast láta þá í athugasemdir eða sendu mér tölvupóst.

Fyrirvari:

I make absolutely no claims as to the suitability of this for any purpose. Use at your own risk.

Uppsetningu skref (að fylgja fyrir hvern WFE í bænum):

1. Sæktu. Zip og þykkni.

2. Install the .dll into the GAC. I usually open c:\Windows samkoma að nota Windows Explorer og afrita það þar.

3. Breyta web.config að bæta samkoma á örugga eftirlit:

<System.Workflow.ComponentModel.WorkflowCompiler>
<authorizedTypes>

<authorizedType Assembly="SpdGenericInterface, Útgáfa = 1.0.0.0, Menning = hlutlaus, PublicKeyToken = abe076fd8125f3c4" Namespace="Nivlag" TypeName="*" Authorized="True" />

4. Copy "SpdGenericInterface.actions" til C:\Program Files Common Files Microsoft Shared vefur framreiðslumaður eftirnafn 12 SNIÐMÁT 1033 Workflow

Athugaðu að ofan staðsetning er sérstaklega ensku innsetningar tungumál.

5. Close SharePoint Designer (if it’s already open).

6. iisreset

7. Open SPD and create a new workflow.

If all goes well, you should be rewarded with a new category of action:

mynd

Skýringar:

Sjá hér (http://blogs.msdn.com/sharepointdesigner/archive/2007/03/15/adding-activities-to-spd.aspx) for a terrific overview of the process for creating, installing and configuring a solution like this.

The .zip is designed to extract directly to you c:\ drive. If you do this, you can open the project and all the paths will be consistent.

To use this in visual studio, you probably need to install "Extensions for Windows WF".

The initial upload contains just one "dispatcher function", "ToLower()". To add more functionality, add it to the Execute method as shown:

 vernda forgang ActivityExecutionStatus
          Execute(ActivityExecutionContext executionContext)
        {

            band functionToDispatch;
            functionToDispatch = þetta.DispatchFunction.ToLower();

            switch (functionToDispatch)
            {
                case "tolower()":
                    {
                        þetta.OutResult1 = þetta.InParam1.ToLower();
                        break;
                    }

                default:
                    {
                        þetta.OutResult1 = "Unknown function: [" + þetta.DispatchFunction + "].";
                        break;
                    }
            }

            aftur ActivityExecutionStatus.Closed;
        } // ActivityExecutionStatus

    }

Þá, re-build the project and copy the assembly to the GAC. I expect an iisreset would be required.

9 hugsanir á "SharePoint Designer — Custom virkni til að framkvæma notandi-útskýra C # virka

  1. Gerry Whitworth
    I followed his directions and everything seemed to work until I choose the action in SP Designer. The designer did not paste the code in the workflow. I sent this guy an email and I guess he is too busy to respond.
    I solved the problem myself.
    Past the actions from "SpdGenericInterface.actions" into the "WSS.actions" file and it everything worked. I hope this helps others.
    Svara
  2. Marco mancinelli
    it sounds good, but I can’t install the extension =(
    my Designer con see it but when i click on it nothing appear… please help… tnx.
    Svara
  3. Bernard Lambeth

    I’m using this custom activity to Replace() virka. The farm is SharePoint 2007, with load-balanced web front-ends. I am getting intermittent failure to start errors, but the workflows usually restart in 5 – 15 min. I believe the timer jobs Workflow and Workflow Failover are restarting the workflows. I reviewed the SharePoint logs, and finally caught this error.

    RunWorkflow: Microsoft.SharePoint.SPException:
    at Microsoft.SharePoint.Workflow.SPNoCodeXomlCompiler.LoadXomlAssembly(String assmNameIn, Spweb vefur)
    at Microsoft.SharePoint.Workflow.SPWinOeHostServices.CreateInstance(Guid trackingId, SPWorkflow workflow)
    at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)
    at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

    I found a reference to this error on another blog, http://www.kentd.com/index.php/all-blog/218-nivlag-and-spdgenericinterface. The author indicated he was using the custom actitivity Replace(), svo og. Have you seen this error? Do you have any suggestions on how to resolve it?

    Svara
    1. Paul Galvin Post höfundur

      Sorry I never responded. At thi’s point, it’s probably moot. I hope you were able to resolve it.

      Svara

Eftir svar

Netfangið þitt verður ekki birt. Nauðsynlegir reitir eru merktir *