André Rentes

Hi,

I created a form library, when a item is created i started a workflow. This workflow create a task that open another infopath form, but I'd like to open the infopath form that created in form library

previously.
Somebody help me please!
Thanks



Re: SharePoint - Workflow Workflow - Using the same infopath form

DaveM.

The Task Form is different from the payload form (the one the workflow is running on) as they typically serve different purposes. I don't know that you can do what you're looking for. The Task form would be looking to load information about the task into the payload form and they're not the same thing.

OK, thinking about it, I suppose you could make it work by setting up your Payload form and Task form Content Types to be the same. I've never done it but in theory it should be possible, if a bit difficult and stilted. Without knowing more about your situation it's hard to say whether it would be worth the effort or whether there is a better solution.

-Dave





Re: SharePoint - Workflow Workflow - Using the same infopath form

Rentes

Thanks DaveM!!

My customer would like to see in task the form saved in library instead of click in link to open the form. He not wants to complete task without to see the form with the information.

What I did

In my infopath form I promotion my fields to sharepoint, with the workflow I read this data and load in task form, but is very hard work and when I have complexes fields

(Repeating Tables) I obtain to show only the first or last data.

Att






Re: SharePoint - Workflow Workflow - Using the same infopath form

Kiran Bellala

Rentes,

I am also having similar set backs in my workflow development. I am not able to successfully show the data from the payload form on the task form, especially the repeating table data.

I tried to write the data from the payload form to a custom column in the task list and then used Extended properties of task to show data from this custom column. This approach works very well with the regular data types but not with repeating table.

Were you able to solve this issue

Kiran






Re: SharePoint - Workflow Workflow - Using the same infopath form

Andre Rentes

Hi Kiran,

I also try to write data from the payload form to a custom column in the task list and then used Extended properties of task to show data from this custom column, but the complex data type i take only the first row( repeating table example ).

To solve this poblem I did:

In infopath form I generate GUID(Key) and promoted this field to sharepoint. The others fields I'm using c# code in infopath to save in DB( SQL SERVER ), including GUID that is a Primary Key. When i open my task the infopath form has a data connection that receives a GUID. The ItemMetadata.xml has a ows_GUID field then I fill my form.

Att






Re: SharePoint - Workflow Workflow - Using the same infopath form

Kiran Bellala

Hello Andre

Thanks for the post.

I may have not completly understoood what you posted. So I am repeating the steps here:

  1. You are creating a GUID in the payload form. This GUID identifies the request.
  2. When the user submits the payload form, along with saving to the form library, you are saving the data to a custom sql table.
  3. In the task form, you are extracting the GUID using the extended properties. Also in the task form load, you are querying the sql table to read the data from the custom table.

Please verify if this is what you did. Also I have another question: are you creating a row in the database table, for each row in repeating table

Thanks

Kiran






Re: SharePoint - Workflow Workflow - Using the same infopath form

Andre Rentes

Hi Kiran

Sorry, I'm learning to write, speak and read english!!! Smile

Step 1 - ok

Step 2 - ok

Step 3 - ok

I created a another table with GUID(PK) to save the repeating table! Each row in repeating table is a row in database table!

I will to send for you the payload form and task form, look your email! Smile

PS.: In payload form I`m using a Repeating Section and not a Repeating Table, but it's same.

Att






Re: SharePoint - Workflow Workflow - Using the same infopath form

Praveen battula

Hi,

if you are developing the workflow in visual studio,

in create task method u give taskProperties.TaskType = 1;

Here 1 is the FormURN in workflow.xml

thanks.





Re: SharePoint - Workflow Workflow - Using the same infopath form

lolivers

Hi,

I had the same problem and solved it in this way:

my infopath schema for the task has a <payload/> element immediately beneath the root element <root/>

so my task xml looks like

<root>

<payload>

<myRepeatingGroup1>

<etc>

The form controls are bound to this payload element and its children. In the workflow OnTaskChanged event, that form contents will then become available via afterProperties.ExtendedProperties["payload"] as an xml string.

Also, in the secondary form datasource, ItemMetaData, I provide an attribute "ows_payload". SP workflow will populate that field with the content of ExtendedProperties["payload"] (the said xml string) before reopening the form.

That's fine, but it's the wrong place. We actually need to have this content in the correct place, in the main datasource, in the <payload/> element. The last missing step therefore is to populate the <payload/> element yourself with some C# codebehind in the infopath form, like so:

public void InternalStartup()
{
EventManager.XmlEvents["/z:row/@ows_payload", "ItemMetadata"].Changed += new XmlChangedEventHandler(ItemMetadata__ows_payload_attr_Changed);
}

public void ItemMetadata__ows_payload_attr_Changed(object sender, XmlEventArgs e)
{
try
{
string payload = e.Site.InnerXml;
XPathNavigator xn = this.MainDataSource.CreateNavigator();
XmlNamespaceManager ns = new XmlNamespaceManager(xn.NameTable);
ns.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-07-09T07:44:43"); // this should be changed to your form namespace!!
XPathNavigator xn2 = xn.SelectSingleNode("/my:root/myStick out tongueayload", ns);
xn2.InnerXml = payload;
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine("infopath exception: " + ex.Message);
}
}

hope this helps

-Leo





Re: SharePoint - Workflow Workflow - Using the same infopath form

Kiran Bellala

Leo,

Thanks a lot for your post. I am going to try this approach and let you all know my results.

Kiran






Re: SharePoint - Workflow Workflow - Using the same infopath form

Kiran Bellala

Leo,

A quick question:

I assume that you are using the VSTA in the task forms to enable all the custom code. I am having issues with specifying the dll of the task form in the feature.xml.

I have copied the dll produced by VSTA code of the task form to the root directory of the workflow feature. This dll is signed with a public key. When I try to open the task form, I get a blank screen with "This form has been closed".

In the event viewer, I get the following error:

Could not load file or assembly 'file:///C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Features\GSDApprovalWorkflowFeature\GSDTask.dll' or one of its dependencies. The system cannot find the file specified.)

My question is:

What is the correct way to deploy a dll produced by VSAT for a atsk form

Should I use <ElementFile> in the feature.xml of workflow to specify the VSTA dll

Thanks a lot.

kiran






Re: SharePoint - Workflow Workflow - Using the same infopath form

Kiran Bellala

I was able to resolve this one. Basically, there is no change to the feature.xml.

We need to install the dll of the VSTA code to the feature directory. To do that I added this line to PostbuildActions.bat (installation script):

xcopy /s /Y "%FEATUREDIR%\*.dll" "%FEATURESDIR%\GSDApprovalWorkflowFeature"

This line copies the dll of the VSTA code to feature directory.

Kiran






Re: SharePoint - Workflow Workflow - Using the same infopath form

lolivers

Kiran,

I did the following:

1. create form with codebehind & build it

2. save form

3. publish form to network location on the filesystem of the MOSS server (without alternate path)

4. stop/restart iis

5. extract the infopath form dll from the .xsn file (I temporarily rename the.xsn to .cab then open the cab with explorer)

6. copy the dll into the feature directory at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\myfeaturename

Note: you do *not* need to specify this dll in feature.xml or workflow.xml, just copying suffices

7. copy also feature.xml, workflow.xml and all .xsn files to the feature directory

(8. if necessary, first deactivate the feature, uninstall the feature usiung stsadm.exe)

9. reinstall the feature, activate the feature using stsadm.exe

10. remove any test workflow from my test list in SP

11. add workflow feature again to my test list in SP

some tips for troubleshooting:

-enable the diagnostics for the .NET assembly loader (fusion) by entering the following registry key using regedit.exe:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
"EnableLog"=dword:00000001

-check the logs in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ for assembly loader errors

as to your problem: could it be you reference other dlls from your codebehind that are not in the GAC

best regards

-Leo