spacer
cornerspacercorner
Reply
Advisor
Magnus
Posts: 26
Registered: 05-18-2010
0 Kudos

ECL Webservice Metastorm BPM v9

Hi everyone!

 

Anyone who has any documentation or sample code about how to use the ECL Webservice in version 9.  I need to be able to start and submit a blank form action with c# code.

 

 

Appreciate any help,

 

Magnus

Frequent Advisor
Carolyn
Posts: 65
Registered: 06-30-2010
0 Kudos

Re: ECL Webservice Metastorm BPM v9

Advisor
Thilo
Posts: 21
Registered: 05-26-2010
0 Kudos

Re: ECL Webservice Metastorm BPM v9

You can use ECL library starting any process you want in v9 too. SDK is not availble at this time but maybe i can help you. 

 

We have received a email listener .net application from metastorm which starts for every received email a new process with email subject, body and attachments too. We rewrite this .net application and have migrate this from v7.6 to v9. I try to introduce which steps are necessary:

 

0. New .net Application in VS2010 with .net4

  

1. becauce SDK is not available i have imported every assembly i found in \ECL.WS\bin and \Engine Directory (not very nice but i have to look for changing namespaces from v7->v9)

 

using Metastorm.ECL.TPObjects;
using Metastorm.ECL;
using Metastorm.ECL.RequestBroker;
using Metastorm.ECL.Support;
using Metastorm.Engine.Common;
using Metastorm.Engine.Errors;
using Metastorm.Engine.Interface;
using Metastorm.Engine.Authentication;
using Metastorm.PS.Listener;

 

2. create Session  and Login

  

ISessionConfigurer2 sessionConfigurer2 = new ESessionConfigurer();           
sessionConfigurer2.ConfigLocation = ListenerConfiguration.BPMConfigurationFile; // Path to EngineServiceConfig.xml

3. Login  (at time we did not test SSO Login in V9, manual Login works)

                // Create a new session               
                FieldList loginData = new FieldList();
                loginData.Add("username", new Field("nt4user",
ListenerConfiguration.BPMUsername)); m_bpmSession = sessionConfigurer2.CreateSession2(); m_bpmSession.ServiceName = ListenerConfiguration.BPMService; try //try SSO { m_bpmSession.Login("WEB;SSO", "0", loginData); } catch //try normal Login { m_bpmSession.Login(ListenerConfiguration.BPMUsername, ListenerConfiguration.BPMPassword); } if (!m_bpmSession.LoggedIn) { // error }

 

 4. start process and submit

// start process
ActionResponse action = m_bpmSession.StartAction(null, 'MyProcess', 'FirstAction', false, null);

//may be our start form has only a subject field
((Field)action.Action.Fields2['subject']).Value = 'subject'

// submit the folder    
SubmitResponse submitRsp = action.Action.Submit();

This shortly describes how to start a new process with c#

Hope this helps you

 

Thilo 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Employee
Noonsy
Posts: 10
Registered: 05-21-2010
0 Kudos

Re: ECL Webservice Metastorm BPM v9

Hi Thilo, thanks for the reply - please note this approach should not be followed as it directly accesses v9 Internal ECL code which will not be supported. There will be a seperate web service to allow v7 ECL developers to continue to use their code with a v9 system.

 

 

 

Our forthcoming SDK - will include samples to explain how this is possible.

 

 

To answer the original question regarding web services the following should help. The documentation will contain other samples as well, but hopefully this will get you started. 

 

 

 

Add a service reference EclWSSvc to the project, pointing at http://localhost/ECL.WS/Service.svc  

 

A Metastorm Client should then declare a ServiceClient object, and ServiceSessionState The client and server configurations contain information about the service binding and location

 

 

 

In your client app.config suggest increasing default sizes for the following

 

maxBufferSize ="41943040"

 

maxReceivedMessageSize ="41943040"

 

maxStringContentLength ="41943040"

 

maxArrayLength ="41943040"

 

 

 

 

 

private EclWSSvc.ServiceClient eclWS;

 

private EclWSSvc.ServiceSessionState eclServiceSession = null;

 

eclWS = new Metastorm.ECL.WSClient.EclWSSvc.ServiceClient();

 

 

 

Provide authentication detail ... eg.

 

 

 

  FormField[] loginData = new FormField[] {

 

new TextField() { Name = "username", Value = "some username", Culture = CultureInfo.InvariantCulture.ToString() },

 

new TextField() { Name = "password", Value = PasswordEncrypt("some password"), Culture = CultureInfo.InvariantCulture.ToString() }

 

  };

 

  eclServiceSession = this.eclWS.Login("WEB;", 0, "", loginData);

 

if (eclWS.IsLoggedIn(eclServiceSession))

 

{

 

    // Can carry out authenticated operations here...

 

}

 

 

 

You need to encrypt the password, I believe the other hyperlink has an example of this. This will be documented & available in the sample clients that come with the SDK.

The SDK client side interfaces will do this encryption for you.

 

 

 

To work with a list do something like as follows (demonstrates how to obtain the first page of 10 blank forms, ordered by map name.

 

 )

 

 

     DataSet ds = new DataSet();

 

 

 

ListResult clientData = this.eclWS.GetList(eclServiceSession,   ListContentsType.Blank, null, "eMapName", "", 1, 10);

 

     string ClientDataOutput = clientData.Data;

 

 

 

System.IO.StringReader xmlSR = new System.IO.StringReader(ClientDataOutput);

 

     ds.ReadXml(xmlSR, XmlReadMode.ReadSchema);

 

   dataGridView1.DataSource = ds.Tables[0];

 

   dataGridView1.Refresh;

 

 

 

 

 

You might then try and perform an action

 

 

 

DataRow alertRow = ds.Tables[0].Rows[0];
      ActionResponse response = eclWS.StartAction(eclServiceSession, alertRow["eFolderID"] as string, alertRow["eMapName"] as string, "action name", false, null);
            // User can refill, cancel, or submit action here...

 

And then logout...
            eclWS.Logout(eclServiceSession); 

 

 

Hope this helps

 

Rich

 

Advisor
Thilo
Posts: 21
Registered: 05-26-2010
0 Kudos

Re: ECL Webservice Metastorm BPM v9

Upps...could you answer the following questions:

 

1. Use of ECL in v7 is documented (PDF) and supported?!

2. Use of ECL in V9 is not supported?!

 

Regards,

Thilo

Employee
Noonsy
Posts: 10
Registered: 05-21-2010
0 Kudos

Re: ECL Webservice Metastorm BPM v9

Hey Thilo, apologies for the delay in responding.

 

Not sure if you've now downloaded the SDK - did our documentation answer the questions you were looking for?

 

To summarise direct use of Metastorm.ECL, Metastorm.ECL.Support is supported for existing ECL solutions that use 7.6 documented classes. (My earlier comment regarding "There will be a seperate web service to allow v7 ECL developers to continue to use their code with a v9 system" is no longer valid - we decided we could offer a much more backwards compatibility - by removing this service).

 

V9 ECL solutions - should use either ECL.WS or ECL.NET SDK Client side interfaces (Metastorm.ECL.Client, Metastorm.ECL.Client.Contracts. Direct access of undocumented classes for v9 feature access -  Metastorm.ECL/Metastorm.ECL.Support are for internal use only.and are unsupported.

 

Hope this helps you.

 

Best Regards

 

Rich

line spacer line
spacerFollow Metastorm on:
spacer Twitter YouTube Blog iTunes LinkedIn Metastorm Community Central, MC2
spacer Copyright © 2011 OpenText Corporation. All Rights Reserved.spacer About Metastormspacer Privacyspacer Legalspacer Site Mapspacer RSSspacer Contact Us
Microsoft Gold Certified Partner
Powered by Windows Azure
line spacer line