Quick flow tutorial (9)-step modification in QF designer

Source: Internet
Author: User

In versions earlier than build100316, QF step modification only supports vs2008 + QF. If the enablestepmodification activity is added when you use QFD, an error is reported on the workflow status page. After querying the documents, we finally found that the SharePoint designer was designedCodeWorkflow does not support modification, while QFD works in the same way as the workflow designed by Sharepoint designer. Therefore, the workflow added by QFD is not supported by Sharepoint.

However, theoretically, the principle of a code-free workflow is the same as that of a code workflow designed by vs2008. Why is vs2008 designed, but Spd and QFD designed?

Open the wrkstat. ASPX page and find the error code:

Foreach (dictionaryentry entry in modifications)
{
Spworkflowmodification mod = (spworkflowmodification) entry. value;
Workflowmodstring = (string) wtbase ["modification _" + mod. Id. tostring () + "_ name"];

These lines of code cycle all the modification enabled by the workflow, and then get the corresponding name with the modificationid. When modification is enabled with vs2008, the content of workflow. XML is as follows:

 
   
   
     modificationurl =" _ layouts/quickflow/wrkmod. aspx " 
     
     
      
      
        step mod 
        
     
       _ layouts/wrkstat. aspx 
      
     
    
   

Wtbase ["modification _" + mod. Id. tostring () + "_ name"] is used to get content in the Modification_93a2410e-8590-44c2-a6cd-4ef60347b380_Name.

If no code workflow is used, workflow. XML does not exist. If modification is forcibly enabled, an error occurs.

By tracking wrkstat. in aspx, when stepmodification is enabled with QFD, it is found that there is corresponding data in modifications. Obviously, by modifying wrkstat. the content of aspx may support modification for code-less workflows designed by QFD and SPD.

Finally, modify the content of wrkstat. aspx as follows:

If (allowmodifications) {string workflowmodstring = ""; foreach (dictionaryentry entry in modifications) {spworkflowmodification mod = (spworkflowmodification) entry. value; try {workflowmodstring = "" + wtbase ["modification _" + Mod. id. tostring () + "_ name"]; // may be empty} catch {}// get mod name and URL form mod contextif (string. isnullorempty (workflowmodstring) & string. isnullorempty (modificationurl )) {If (! String. isnullorempty (mod. contextdata) {response. write (mod. contextdata); string [] arr = Mod. contextdata. split (','); If (ARR. length = 2) {workflowmodstring = arr [0]; modificationurl = arr [1];} else {continue ;}} string workflowmodurl = web. URL + "/" + modificationurl + "? Id = "+ listitem. ID + "& list =" + request. querystring ["list"] + "& workflowinstanceid =" + strguidworkflow + "& source =" + sphttputility. urlkeyvalueencode (request. rawurl); string workflowmodurlwithsub = workflowmodurl + "& modificationid =" + Mod. id. tostring ();

By default, the system obtains the modification name and modificationurl through workflow. xml.

The contextdata attribute of spworkflowmodification obtains the modification name and modificationurl.

Contextdata Initialization is handled in enablestepmodification:

 
This. enableworkflowmodification1.methodinvoking + = new system. eventhandler (this. enablemod_invoking); Private void enablemod_invoking (Object sender, eventargs e) {contextdata = "Step modification, _ layouts/quickflow/wrkmod. aspx ";}

Finally, after testing, this solution is completely feasible-the latest version of QFD supports step management and is easier to implement than vs2008 + QF. Drag

Enablestepmodification:

The functions described in this article require the support of QF build100320 and QFD build100323 and later versions.

Http://quickflow.codeplex.com/

 

Note:

The solution described in this article modifies the system default page and will automatically overwrite wrkstat when installing the latest qf wsp. on the ASPX page, if you find that the solution in this article conflicts with other Moss + WF scenarios, you can replace the wrkstat_bak.aspx page in the layouts directory with wrkstat. on the ASPX page, wrkstat_bak.aspx is the backup of the original system page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.