Monday, January 31, 2011

Centralized Configuration - Sharing one AgilePoint Configuration List among Site Collections

In SharePoint Integration v2, AgilePoint Configuration List is needed at the top level site to store the info for AgilePoint Server (URL, username, password, etc).
With this, you need to configure this list for each site collection you have.

If you have hundreds of site collections, configuring and maintaining hundreds AgilePoint Configuration List for site collections are just not efficient.

Here is a way you can configure a centralized AgilePoint Configuration List that can be shared by all the site collections in a SharePoint farm.

Insert below entries in the web.config file of your SharePoint web application.

<appSettings> 
<add key="APSettingsListName" value="AgilePoint Configuration" />
<add key="APSettingsSiteUrl" value="http://demo3:8081" />
<add key="APSettingsWebName" value="" />
</appSettings>


Where:

APSettingsListName = The name of the AgilePoint Settings List.



APSettingsSiteURL = The SharePoint SiteURL that contains the common AgilePoint Configuration List. The rest of the site collections will refer to this location and list as long as the individual AgilePoint Configuration list (which is auto-created in the site collection when this feature is activated) is deactivated or removed.



APSettingsWebName = If this field is left blank, this means that the AgilePoint Configuration List is located at the top-level site. A value would indicate the Sub site name.



After this, you might just goes ahead to activate the "AgilePoint Process Launcher" feature, so that process can be triggered for items inserted into the SharePoint. But, you will run into below error:



image



image



To fix this, you may remove the ActivationDependencies node (see below) from the feature file of "AgilePoint Process Launcher". The feature file is located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\AgilePointWFIntegration\feature.xml.



    <ActivationDependencies>


        <ActivationDependency FeatureId="A379136F-8742-4f0c-9D5A-9310A4D2B80C"/>


       </ActivationDependencies>




This shall let you to activate the "AgilePoint Process Launcher" feature without needing to activate the 'AgilePoint Configuration List' feature on each site collections.



 

Friday, January 28, 2011

SharePoint Integration Upgrade - A deployment or retraction is already under way

This is for both of the cases of upgrading SharePoint Integration using the upgrade installer and also manually using the stsadm tool. If you see error below, that means there are previously run command to upgrade the solution files for SharePoint Integration, but the deployment was not completed for certain reason and stuck at that point.

Below is the log of upgrading using the upgrade installer. It's the same error for the case of upgrading manually using the stsadm tool.

1/28/2011 11:05:07 AM>>Updating SharePoint Integration v2... started
1/28/2011 11:05:07 AM>>StartDeployment start
1/28/2011 11:05:07 AM>>SharePoint Integration v2: Information, Upgrading solution Ascentn.SharePoint.SettingsList.wsp in SharePoint ...
1/28/2011 11:05:07 AM>>stsAdmProcess.StartInfo.Arguments: -o upgradesolution -name Ascentn.SharePoint.SettingsList.wsp -filename "C:\Documents and Settings\Administrator\Local Settings\Temp\ckz_1OML\NET20\SharePointv2\Ascentn.SharePoint.SettingsList.wsp" -immediate -allowgacdeployment
1/28/2011 11:05:23 AM>>SharePoint Integration v2: Error, A deployment or retraction is already under way for the solution "ascentn.sharepoint.settingslist.wsp", and only one deployment or retraction at a time is supported.

You may use the following steps to cancel the uncompleted jobs, then run the upgrade installer again or run the upgradesolution command again if upgrade manually.

Run enumdeployments command to get the job IDs:

stsadm -o enumdeployments

The return string looks like this:

<Deployments Count="4"> 
<Deployment JobId="71d06ccb-f5d9-4ae5-8caf-7223130c2a70">
<Title>Windows SharePoint Services Solution Deployment for "ascentn.sharepoint.listform.wsp"</Title>
<Type>Upgrade</Type>
<State>Failed</State>
<File>ascentn.sharepoint.listform.wsp</File>
<ServerType>Front-end Web server</ServerType>
</Deployment>
<Deployment JobId="962557ba-21e7-4739-9b6e-3e38446b477d">
<Title>Windows SharePoint Services Solution Deployment for "ascentn.sharepoint.settingslist.wsp"</Title>
<Type>Upgrade</Type>
<State>Failed</State>
<File>ascentn.sharepoint.settingslist.wsp</File>
<ServerType>Front-end Web server</ServerType>
</Deployment>
<Deployment JobId="add88985-159a-493f-a6f3-26f8918f6517">
<Title>Windows SharePoint Services Solution Deployment for "ascentn.sharepoint.webparts.wsp"</Title>
<Type>Upgrade</Type>
<State>Failed</State>
<File>ascentn.sharepoint.webparts.wsp</File>
<ServerType>Front-end Web server</ServerType>
</Deployment>
<Deployment JobId="08fb8dac-a290-4466-966d-b06fab38b465">
<Title>Windows SharePoint Services Solution Deployment for "ascentn.sharepoint.wfintegration.wsp"</Title>
<Type>Upgrade</Type>
<State>Failed</State>
<File>ascentn.sharepoint.wfintegration.wsp</File>
<ServerType>Front-end Web server</ServerType>
</Deployment>
</Deployments>


Then, run the canceldeployment command to cancel all the uncompleted jobs related to AgilePoint SharePoint Integration.



stsadm -o canceldeployment -id "GUID jobId"




After this, you may run the enumdeployments command again to check the jobs are canceled.



stsadm -o enumdeployments



At this point, you are good to run the upgrade installer or upgradesolution command again.

Friday, January 21, 2011

SPSecurity.RunWithElevatedPrivilages Error

 

If you are getting the 'SPSecurity.RunWithElevatedPrivilages()' error at SharePoint (see picture below), that means the application pool identity of your SharePoint web application does not have enough privilege to write to the event viewer on your SharePoint machine. Your network administrator shall be able to help you with this. If you need more details, the Pre-Installation Guide and Installation provide you the full details for SharePoint installation. This error is not caused by AgilePoint.

image

Thursday, January 20, 2011

Clustering Server Manager (CSM) Implementation - Network Load Balancing

We had made things a bit more seamless and easy in 5.0 SP1 release as far as cluster is concerned so I have listed both approaches based on whether you want to stay on 5.0 release of AgilePoint or want to upgrade to 5.0 SP1.

Irrespective of which option you go for make sure following things are done in your environment which are pre requisites of any NLB app

1) Make sure web.config of AgilePoint Server and Enterprise Manager has SessionState set to SQLServer. For example,

<sessionState mode="SQLServer"

regenerateExpiredSessionId="true"

timeout="30"

sqlConnectionString="Server=<server-name>;Trusted_Connection=True;"

stateNetworkTimeout="30"/>

2) Ping from one machine to another, i.e. ping machine A from machine B and from B to A

3) Make sure firewall is off on both machine

Option 1

If your CSM component needs to be installed on separate server outside AP server farm. This is what we supported till 5.0

1) Install AgilePoint CSM component on an server which is outside AgilePoint farm servers. It has a very small footprint so can be installed on any existing server like database server. It does not need dedicated machine of its own.

2) Activate both AgilePoint servers with NLB keys.

3) Open AgilePoint Server Configuration utility. You will start seeing a new field  for cluster server manager. You need to replace machine name with name of machine where you installed CSM component. Save configuration and reset IIS. Do this on both machines.

image

4) Once you have done step 3 on both servers, you can go to machine where you installed CSM and we provide a utility there to test your NLB is working fine or not. If you have an old installation, your folder name is 'Ascentn Corp'. If you have new installation, then 'AgilePoint' will be your folder name. I have an old installation in picture below. Once you run this as shown below you should get response from both machines. If you see that it means NLB is fine.

clip_image004

 

Option 2

We were getting request from customers that can they install AgilePoint CSM on same machine as AgilePoint server so that they do not have to worry about managing it on other machine. In 5.0 SP1, we have added a new logic such that it can be hosted on same machine. Here is what you need to do.

1) Using 5.0 installer, install AgilePoint CSM on both AgilePoint servers. Use NLB keys for activation of both servers.

2) Upgrade both machines to AgilePoint 5.0 SP1 by running the upgrade package. This is a straight forward upgrade.

3) There is an entry to be made in the registry to point the CSM to AgilePoint database. This contains a connection string. In this case you do not have to set cluster server manager machine name as done in step 3 of option 1. The reason is that CSM is on that machine so it does not need this information separately.

You would need to manually create one registry key for option 2 since CSM is going to be on same machine as AP server. Here is the key which need to be created

clip_image006

In this registry value copy AgilePoint Database connection string to CSM registry. You can get this value from your netflow.cfg file. Please take note of the DB provided in front section of the connection string, e.g. MSSQLDatabase: connection lifetime=5;min pool size=10;server=T410-1;database=AgilePoint47;trusted_Connection=yes

4) Click ok on AgilePoint Configuration Utility and reset IIS. This needs to be done on both machines. Please note that in this case you should not see the cluster server manager textbox in AP configuration utility as in option 1. If you see that you need to delete one entry from registry or netflow.cfg file.

5) After making above entry on both machines, restart CSM (windows service on both machine). Please make sure that the logon identity for CSM windows service is having DBO privileges on AgilePoint database.

· Query database and make the CSM works, i.e. you can see WF_CLSUTER_SERVER_URI has one record.

clip_image008

If you see URL=machineA:13841, stop CSM window service on machine A and query again. You will see URL will be MachineB:13841.

· Now make sure both machine windows services are started. Run iisreset and check the AgilePont Server log file.

One machine will have:

010-11-07 16:51:12.688 >>> Initialize Cluster Event Dispatcher, uri=tcp://T410-006:13481/192.168.0.24/55a1a2b7-46cb-4148-a15f-a4e2a18d1b44:False

The other machine have:

2010-11-07 16:51:02.564 >>> Initialize Cluster Event Dispatcher, uri=tcp://T410-006:13481/192.168.0.24/97adaa57-8d82-47e9-aafb-f50c0c667a0c:True

Here, the 'True' means it is the master server.

6) Now use the ping utility to test for NLB as done in option 1

Both options do not take much time. Only difference is whether you want to install CSM on same machine or different machine.

AgileForms - Beta or Released Version?

How do I know if the AgileForms installed in my machine is the beta version or the released version?

If you have below registry key, that means you have the released version of AgileForms (v5.0 SP1). If this key does not exist in your environment, that means you have the beta version of AgileForms. It is recommended that you uninstall the beta version and install the release version. There is no upgrade from the beta version to the released version for now.

HKEY_LOCAL_MACHINE\SOFTWARE\BWS\AFEControl\AFVersion

image

Wednesday, January 19, 2011

Update InfoPath Activity Suspended

A customer is working with InfoPath form with attachment. When the attachment size grows bigger and bigger, the process is suspended at the Update InfoPath Activity. See picture below.

image

I usually do not recommend to attach large attachment to InfoPath, because the whole xml of InfoPath is submitted to AgilePoint every time the user completes the task. The larger the attachment, the slower the data transfer between SharePoint and AgilePoint.

For large attachment, I suggest to keep that attachment file in a library in SharePoint, then keep the link of that attachment in the InfoPath form. Then user can still open up the attachment from the InfoPath form.

The other thing can be looked into is the maxRequestlength setting in the web.config of AgilePoint and SharePoint. See this KB. But this will not help much on the speed/performance if the file is too large. The bandwidth of the network actually becomes the bottleneck in this case.

AgilePoint ASP.NET - base.CompleteWorkItem() not working

AgilePoint Web Project provides a framework for your to develop your custom workflow web application with AgilePoint capability. In come cases, the base.CompleteWorkItem() at your aspx page does not complete the work items. Here is an alternative to call the CompleteWorkItem method.

Here is your code which calls the base.CompleteWorkItem():

private void SubmitClick(bool Approved)

{

NameValue[] nvs = new NameValue[] { new NameValue("/pd:myFields/pd:Approval", Approved) };

base.SetCustomAttrs((string)base.GetWorkObjectID(), nvs);

base.CompleteWorkItem();

....

}

You can override the CompleteWorkItem() method and call --> this.CompleteWorkItem() :

Sample Override

You may call the CompleteWorkItem() method from the WFWorkflowService object (it's represented by the variable api below) directly. Another benefit to do this is, you may inspect the WFEvent object returned from api.CompleteWorkItem() to see if it is failed or succeeded. (Note: base.CompleteWorkItem() return void, so you can't inspect the event status)

Please note that the loop in below code that waits for 1 second and checks the event status again is for testing or debugging purpose only. If you put this code in production every time you call the CompleteWorkItem() method, it might cost performance issue.

protected override void CompleteWorkItem()

{

// base.CompleteWorkItem(); <-- do not call the base method

if (base.GetWorkItemID() == null)

{

Logger.WriteLine("Lost Work item ID from ViewState[WID]...");

// ToDo: You might want to provide an alert message here

}

base.WriteBindingControls();

if (base.GetAPI() == null)

{

Logger.WriteLine("Lost API from the SessionState...");

// ToDo: You might want to provide an alert message here

}

IWFWorkflowService api = base.GetAPI();

WFEvent evt = api.CompleteWorkItem(base.GetWorkItemID()); // Submit Complete Work Item

System.Threading.Thread.Sleep(1000); // 1 sec wait

WFEvent evtUpdt = api.GetEvent(evt.EventID);

while (evtUpdt.Status == WFEvent.SENT) // Inspect event status

{

System.Threading.Thread.Sleep(1000); // 1 sec wait

evtUpdt = api.GetEvent(evtUpdt.EventID);

}

if (evtUpdt.Status == WFEvent.FAILED)

{

Logger.WriteLine("Failed Work Item Completion request xxxxx - Check AP Server Log");

// Potential errors that can be gleaned from the AP Server Log are:

// 1. Ownership of the workitem - requester is different from the assigned user

// i.e. Failed to complete the task due to ownership with Request User={0} and Assigned User={1}

// 2. UserID for the work item is null

// i.e. Failed to complete the task with WorkItemID={0} because there is no assigned user.

// 3. Work Item has null Activity Instance ID

// i.e. Failed to create work item because the activity is not found with process='{0}',ActivityID={1}, and Sender='{2}'

// 4. this work item depends on child work items

// i.e. Failed to complete work item because he work item is trying to be completed depends on child work item(s), Process='{0},{1}/{2}/ID={3}' WorkItemID='{4}', Child WorkItemID='{5}'

}

else if (evtUpdt.Status == WFEvent.PROCESSED)

{

Logger.WriteLine("Processed Work Item Completion request xxxxx");

}

}

SESSION_STATE_PASCAL_CASED is not configured properly

In this case, the following error appears many times in the Event Viewer. 

InfoPath Forms Services has detected a mismatch between the user's data in the browser and on the server. This may indicate the SESSION_STATE_PASCAL_CASED is not configured properly on a multiple front end farm or that a malicious user is trying to tamper with client data. (User: MYDOMAIN\username123, Form Name: ABCForm, IP: , Request: http://myserverXYZ/_layouts/Postback.FormServer.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:ABCForm:-myXSD-2005-10-21T21-12-27)

 

This is a common SharePoint issue that your SharePoint admin would be able to help. This error also happens when the shared service in SharePoint central admin is not configured properly. After creating a new shared service, that error went away.

You may also try the following. Clear browser's cache and try again and if that doesn't solve the problem then run the following command: 

stsadm -o reconvertallformtemplates

See this link for more details.

Your SP admin would be best person to help with this. This is not related to AgilePoint as such.

Monday, January 17, 2011

Checking .NET version in MSI

The Setup Project  in Visual Studio .Net provides  you a convenience way to check the pre-requisite .NET Framework version required before allowing your installation takes place. But, there are only limited .Net version that are available. See picture below for available .Net Framework versions.

image

For example, if you need to check .NET Framework 3.5 SP1, then the Setup Project can't check that for you. In this case, you need to write custom code to check the registry entry for 3.5 SP1. Refer to article below for the registry entries of .NET Framework.

How to determine which version and service pack levels of Microsoft .NET Framework are installed

Where Can I find the error logs?

Knowing the locations of log files comes very useful when you are facing issue and trying to troubleshoot.

AgilePoint Server:

[VirtualServerDirectory]\AgilePointServer\log, e.g. C:\BPMWebSite\AgilePointServer\log

 

SharePoint Integration v2:

  1. Check the log file location at the AgilePoint Configuration List in your SharePoint site.

image

  1. AgileConnector logs: [VirtualServerDirectory]\AgilePointServer\log\AgileConnector, e.g. C:\BPMWebSite\AgilePointServer\log\AgileConnector
  2. In some extreme cases, some errors will be logged at the Event Viewer.

SharePoint General Error

If you see a general error message at SharePoint, e.g. 'Unknown Error' with a 'Go back to site' link, see pictures below, you can see the full error thrown by SharePoint by modifying a few entries in the web.config of SharePoint web application, i.e. the stack trace, the debug mode and the custom error mode. Search and set following values. It will let you know exactly what failed. Remember to backup your web.config before any changes.

For SharePoint 2010, you need to modify this in two web.config files, i.e. the web.config of SharePoint web application root (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\12345YourPortNumber), and also the web.config under the layout folder (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS).

Do this:

  1. Set CallStack="true"
  2. Set debug="true"
  3. Set customErrors mode="Off"

For example:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

<customErrors mode="Off" />

<compilation batch="false" debug="true">

 

General error page from SharePoint:

image

image

Tuesday, January 11, 2011

Failed to access system resource


System.InvalidOperationExceptions: Failed to access system resource., exception has been thrown by the target of an invocation at Ascentn.Workflow.WF8341.LicenseHandler.ReadLicenseFile(StringFileName) at Ascentn.Workflow.WF8341.LicenseValidator.Execute()
Ascentn.Workflow.WF8341.LicenseValidator.Validate()

This error message "Failed to access system resource" is a typical privilege issue for the account that is running the AP Server installer. As can be gleaned from the stack trace, the error is thrown at the point where it is about to read the "xx\Program Files\Common Files\Ascentn\AgilePoint Server.dat"  license file. The solution is, run the AP Server installer as a local administrator account (or "Run as administrator"), to be able to have access to the license file (xx\Program Files\Common Files\Ascentn\AgilePoint Server.dat). This should resolve the issue.

Trace:
------

System.InvalidOperationExceptions: Failed to access system resource., exception has been thrown by the target of an invocation at Ascentn.Workflow.WF8341.LicenseHandler.ReadLicenseFile(StringFileName) at Ascentn.Workflow.WF8341.LicenseValidator.Execute()
Ascentn.Workflow.WF8341.LicenseValidator.Validate()

Turn Off UAC while installing AP Server:
----------------------------------------

http://techontip.wordpress.com/2010/06/02/turn-off-user-account-control-in-windows-2008-r2/

OR

--> Control Panel -> Change User Account Control Settings -> Never Notify

Thursday, January 6, 2011

Upgrade SQL 2005 to SQL 2008

If you are planning up upgrade to your SQL instance for AgilePoint Server, is there any AgilePoint specific information that should be aware of? Is this supposed to simple as restoring a backup of 2005 database onto a 2008 instance?

Upgrading the database for AgilePoint Server is straight forward. You have to just restore 2005 backup on 2008. Once restore is done, you will have to associate the database in AgilePoint Server configuration to pick the latest database.

Wednesday, January 5, 2011

Set SPN

When to set SPN? Here is a quick summary. See AgilePoint Pre-Installation Guide for full details.

  AgilePoint Server SharePoint Server
NTLM No need to set SPN Default to NTLM, No need to set SPN
NTLM & Kerberos Need to set SPN Need to set SPN
Kerberos Need to set SPN Need to set SPN

 

Further reference:

How to configure IIS to support both the Kerberos protocol and the NTLM protocol for network authentication

Tuesday, January 4, 2011

AgilePoint Server Working Thread

A customer reported that AgilePoint Server working thread increases to 123 (it was about 1o before) with below warning message after applying v5.0 SP1.

 

Subject: Warning : AgilePoint configuration may need to be modified.

Dear System Administrator,
Database concurrent connections exceed 90% of max pool size (100).
For performance concern, AgilePoint configuration may need to be modified.

 

This is not related directly to v5.0 SP1 upgrade. It is just picking up the max Pool Size (from the netflow.cfg -> defaults to 100 if not configured) and compares it with the Maximum DB counter connections used (and not necessarily the current connection). This is just a warning massage suggesting that the ‘Max Pool Size’ value can be increased, but this does not indicate that the current connection is high. It is just that at some point in time it has reached a high (counter) value that exceeds 90% of the maximum pool size.

The tendency of  declaring high value threads of [ eventCap="200" workingCap="200" ] is, it consumes as much DB pool as possible and hence it artificially bloats the DB connections driven by the large pool of the Event Threads and Working Threads. The currently running processes is not really high  [1,267]  and hence they can manage by just using [ eventCap="50" workingCap="50" ], but if they insist on setting it at  [ eventCap="200" workingCap="200" ] then increase the ‘Max Pool Size’ value shall be increased accordingly.

image

Netflow.cfg:

<database vendor="MSSQLDatabase" connectingString="application name=AgilePoint Server;connection lifetime=5;Max Pool Size=200;min pool size=10;server=T500-ARNEL;database=APDB;trusted_Connection=yes" />

AP Server Configuration:

clip_image002[4]

 

clip_image002[6]

Refer to the AgilePoint Performance Optimization, Scalability and Tuning Guide for more details about AgilePoint Server tuning.

Monday, January 3, 2011

WFGridView Example

The goal of this article is to show you the example of using WFGridView control, which is not included in the AgilePoint User Guide. For other details, please refer to the AgilePoint User Guide. WFGridView is a control to handle repeating data. The repeating data is stored in a tree of repeating nodes in the form of XML.

  1. In Envision, define the repeating nodes structure in the XML schema of the process model. In this example, it is the Items hive. Each Item has childnodes for Name, Price and Quantity (Qty). See picture below for the repeating node structure. It is assumed that the process model is located under the Process Template folder of your ASP.NET project at this point. Save and close Envision.
    • image
  2. The newly added repeating nodes structure is now reflected in the schema.xsd
    • image
  3. In your ASPX page, drag and drop the WFGridView control to the location desired in the page.
  4. Configure the BindingName property of the WFGridView control by selecting the root node the the repeating nodes hive. In this example, it is "pd:FoodOrder/pd:Items" (Not "pd:FoodOrder/pd:Items/pd:Item").
    • image
  5. Also, add another button for inserting new rows to the WFGridView control. It is called btnAddRow with the display text as "Add Items" in this example.
  6. Implement below codes in the button click event for btnAddRow.

      protected void btnAddRow_Click(object sender, EventArgs e)
      {
          DataTable dt = this.WFGridView1.RepeatingSectionDataSource;
          DataRow dr = dt.NewRow();
          dr[0] = "Updated";
          dr["pd:Name"] = "Enter Name Here";
          dr["pd:Qty"] = "";
          dr["pd:Price"] = "";
          dt.Rows.InsertAt(dr, 0);
          this.WFGridView1.RepeatingSectionDataSource = dt;
          this.WFGridView1.EditIndex = 0;
          this.WFGridView1.BindRepeatingSectionDataSoure();
      }

  7. Here is the example of the HTML code for the WFGridView:

                <tr style="height:100%">
                    <td style="width: 366px">
                        <ap:WFGridView ID="WFGridView1" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" BindingName="/pd:FoodOrder/pd:Items" InnerXmlTemplate="PHBkOkl0ZW0geG1sbnM6cGQ9Imh0dHA6Ly93d3cuYXNjZW50bi5jb20vYnBtL1hNTFNjaGVtYSI+PHBkOk5hbWU+U3RyaW5nPC9wZDpOYW1lPjxwZDpRdHk+RGVjaW1hbDwvcGQ6UXR5PjxwZDpQcmljZT5TdHJpbmc8L3BkOlByaWNlPjwvcGQ6SXRlbT4=" ShowFooter="True" >
                            <Columns>
                                <asp:BoundField DataField="pd:Name" HeaderText="Name" />
                                <asp:BoundField DataField="pd:Qty" HeaderText="Qty" />
                                <asp:BoundField DataField="pd:Price" HeaderText="Price" />
                            </Columns>
                        </ap:WFGridView>
                        <asp:Button ID="btnAddRow" runat="server" OnClick="btnAddRow_Click" Text="Add Item" /></td>

                </tr>

Download the sample source code here.

image

image