Pages

Saturday, 12 March 2011

Duet Enterprise Workflow SharePoint Extension Asp.Net C#

This is a follow up blog on a SAP blog about how to develop a custom workflow solution on the backend. This blog is to explain how workflow works on the SharePoint side and offer some customization entry points for you to create extended solutions leverage SAP backend process and SharePoint workflow and flexible UI options. First, let us review how workflow function is working on Duet Enterprise.DE workflow feature enables SAP business process expose to SharePoint in a declarative manner. It abstracts away the site structure needed to keep the distinct task types from exposing to the calling application. Each workflow decision step maps to a SharePoint task type. Each task type is hosted within a workflow subsite that is built on top of the taskflow template. The customization can be applied per task type without changing any backend code. SAP creates tasks via Duet Enterprise workflow service. SP end user interact with backend process via BDC task entity’s user actions to send decision result back.

 

When we configure workflow on the SharePoint side, we are essentially registering a set of target URLs for SAP to send documents to. For each task type, we are assigning a subsite and a target library. When SAP sends XML payload to the SharePoint business data document library, the SharePoint approval workflow is started. Approval task is generated. Duet Enterprise provides a task interface that includes additional web parts and SAP data. In this blog, we will talk about options of customizing the SharePoint user interface.

Follow Edward Lu’s blog on how to configure and develop workflow on the SAP backend. In our scenario, our use case is a custom invoice approval process. We have already created a SAP workflow outbound handler and an inbound handler to expose the key decision making steps and let SharePoint users to consume the step and interact with the workflow task via SharePoint workflow workspace. SharePoint workflow extension Options:1.    Building dynamic “related links” or “Related Actions” with workflow parameters from the SAP backend; one use case is to  take user to the collaborative workspace based on related entities.

 You can configure Related Actions list to open collaboration workspace to show user the workflow related contextual information. DUET ENTERPRISE related actions web part will pick up the token and replace with the correct value below.
In this case, I am opening up a purchase order collaboration workspace that is related to this workflow. Say I want to approve PO ID 10010. SAP sends the POID extended property within the BizDoc XML payload. SharePoint will use this parameter to open the workspace for the specific business entity.

Alternatively, if I want to open a site page or application page or external page with the SAP parameters, I can configure the related links list to make it happen.In this case, I added an item to related links list and try to use the SAP biz document extended property named URL to generate a dynamic link.

http://www.bing.com/search?q={biz.URL}

2.    Customize Task interface by modifying the SPD generated InfoPath form associated with the approval workflow.

 

1.  Modify the WRKTASKIP.aspx site page. You can add custom web parts, custom user controls, etc. to this page to extend the task UI. You can also suppress the InfoPath control and use your custom web part to interact with the workflow instance and setting the decision result and complete the workflow.

For example, you can have your custom web part to take additional user input and set the value for task item and complete the current workflow instance. SPWorkflowTask.AlterTask((task as SPListItem), ht, true);

 2.  You can modify the OOB SPD generated approval workflow. For instance you can add custom workflow activities or even plug in your own workflow to associate with the bizdoc library.

Finally, since as we pointed out earlier, the workflow in Duet Enterprise is designed to declarative and template based. After your customization, you can save the template for deployment and future reuse with other task types.

 Hope this helps,happy coding.

0 comments:

Post a Comment

 
Powered by Blogger