SharePoint Designer — Aktiviteti Custom për të ekzekutuar user-defined funksione C #

UPDATE: Kjo ka qenë të lëshuara në CodePlex këtu: http://www.codeplex.com/spdwfextensions

UPDATE: Shih këtu për shënimet e lëshimit të fundit: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!381.entry

UPDATE: Shiko këtu për mendimet e mia në komercializimin e këtij projekti: 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 (dërgim) any C# function that you incorporated into the linked assembly.

Që nga fundi i tetorit, 2007, this is just an initial version of the project. I plan to expand it with a number of additional functions, përfshirë substring, indeks, zëvendësoj, 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.

Nëse keni ndonjë koment, pyetje apo sugjerime, ju lutem të lënë ato në komentet ose email mua.

Mohim:

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

Hapat e instalimit (për të ndjekur per secilin WFE ne fermë):

1. Shkarko dhe ekstrakt zip..

2. Install the .dll into the GAC. I usually open c:\windows kuvendi duke përdorur Windows Explorer dhe kopjoni atë atje.

3. Ndrysho web.config për të shtuar asamblenë për kontrolle të sigurta:

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

<authorizedType Assembly="SpdGenericInterface, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = abe076fd8125f3c4" Namespace="Nivlag" TypeName="*" Authorized="True" />

4. Copy "SpdGenericInterface.actions" për C:\Program Files Common Files Microsoft Shared extensions web server 12 MOSTRA 1033 Workflow

Vini re se lokacioni më sipër është specifik për instalimet e gjuhës angleze.

5. Mbylle SharePoint Designer (në qoftë se ajo është tashmë e hapur).

6. iisreset

7. Hapni SPD dhe të krijojë një workflow të re.

Nëse gjithçka shkon mirë, ju duhet të shpërblehet me një kategori të re të veprimit:

imazh

Shënimet:

Shoh këtu (http://blogs.msdn.com/sharepointdesigner/archive/2007/03/15/adding-activities-to-spd.aspx) për një vështrim të frikshëm të procesit për krijimin e, instalimi dhe konfigurimi i një zgjidhje si kjo.

. Zip është projektuar për nxjerrjen direkt për ju c:\ drive. If you do this, ju mund të hapur projektin dhe të gjitha rrugët do të jenë në përputhje.

Për të përdorur këtë në vizual studio, you probably need to install "Extensions for Windows WF".

The initial upload contains just one "dispatcher function", "ToLower()". To add more functionality, shtoni atë në Execute metodë siç tregohet:

 mbrojtur shkel ActivityExecutionStatus
          Kryej(ActivityExecutionContext executionContext)
        {

            varg functionToDispatch;
            functionToDispatch = kjo.DispatchFunction.ToLower();

            kaloni (functionToDispatch)
            {
                rast "tolower()":
                    {
                        kjo.OutResult1 = kjo.InParam1.ToLower();
                        pushim;
                    }

                parazgjedhur:
                    {
                        kjo.OutResult1 = "Unknown function: [" + kjo.DispatchFunction + "].";
                        pushim;
                    }
            }

            kthehem ActivityExecutionStatus.Mbyllur;
        } // ActivityExecutionStatus

    }

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

9 mendime mbi "SharePoint Designer — Aktiviteti Custom për të ekzekutuar user-defined funksione C #

  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.
    Unë zgjidhur problemin veten.
    Past the actions from "SpdGenericInterface.actions" into the "WSS.actions" file and it everything worked. I hope this helps others.
  2. Marco MANCINELLI
    hi të gjitha,
    mund dikush të shpjegojë cilat fotografinë web.config i kanë për të modifikuar? ju lutem përgjigje së shpejti.
  3. Marco MANCINELLI
    kjo tingëllon mirë, por unë nuk mund ta instaloni zgjerimin =(
    con tim Designer shohin atë, por kur unë klikoni mbi të asgjë nuk duket… ju lutem më ndihmoni… tnx.
  4. Mike Mongeau

    Definitely tingëllon si një ide e mirë. Unë do të duan të përzihen në përdorimin dhe testimin e funksioneve. Është e vërtetë se funksionet string janë të kufizuara në SPD, but the "Dynamic String Builder" është shumë i fuqishëm.

    <a href ="http://dataformwebpart.com">-Monjo </një>

  5. Bernard Lambeth

    I’m using this custom activity to Replace() funksion. 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 web)
    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(), po ashtu. Have you seen this error? Do you have any suggestions on how to resolve it?

Lini një Përgjigju me Marco MANCINELLI Cancel përgjigje

Adresa juaj e emailit nuk do të publikohet. Fusha e kërkuar janë shënuar *