The following C# code example invokes a long-lived process named MortgageLoan - Prebuilt. Notice that this process is invoked asynchronously. This quick start contains a user-defined method named GetDataSource that creates XML data that is passed to the process. The XML data is created using a MSXML2.DOMDocument50Class instance. (See Invoking Human-Centric Long-Lived Processes.)using System;using System.Collections;using System.ComponentModel;using System.Data;using System.IO;namespace ConsoleApplication1{class Program{static void Main(string[] args){try{//Create a ReaderExtensionsServiceService client objectMortgageLoanPrebuiltService mortgageClient = new MortgageLoanPrebuiltService();mortgageClient.Credentials = new System.Net.NetworkCredential("administrator", "password");//Create XML data to send to the long-lived processMSXML2.DOMDocument50Class xmlData = getXMLSource();XML inXML = new XML();inXML.document= xmlData.xml;//Invoke the long-lived processString invocationID = mortgageClient.invoke_Async(inXML);//Create a Job Manager object to check the//results of an asynchronous requestJobManagerService jobManager = new JobManagerService();jobManager.Credentials = new System.Net.NetworkCredential("administrator","password");//Create a JobID object that represents the status of the//long-lived operationJobId jobId = new JobId();jobId.id = invocationID;jobId.persistent = true;JobStatus jobStatus = jobManager.getStatus(jobId);System.Int16 val2 = jobStatus.statusCode;Console.WriteLine("The value of the long-lived operation is "+val2);}catch (System.Exception ee){Console.WriteLine(ee.Message);}}//Create XML data to pass to the long-lived processstatic private MSXML2.DOMDocument50Class getXMLSource(){MSXML2.DOMDocument50Class myXMLDoc = new MSXML2.DOMDocument50Class();MSXML2.IXMLDOMElement MortgageApp = null;MSXML2.IXMLDOMElement MortgageFields = null;MSXML2.IXMLDOMElement ApplicantFields = null;MSXML2.IXMLDOMElement PropertyPrice = null;MSXML2.IXMLDOMElement DownPayment = null;MSXML2.IXMLDOMElement Term = null;MSXML2.IXMLDOMElement Mortgage = null;MSXML2.IXMLDOMElement InterestRate = null;MSXML2.IXMLDOMElement LastName = null;MSXML2.IXMLDOMElement FirstName = null;MSXML2.IXMLDOMElement PhoneNumber = null;MSXML2.IXMLDOMElement SSN = null;//Create MortgageApp - the root element in the XMLMortgageApp = myXMLDoc.createElement("MortgageApp");myXMLDoc.appendChild(MortgageApp);//Create Mortgage fields and append it to MortgageAppMortgageFields = myXMLDoc.createElement("MortgageFields");MortgageApp.appendChild(MortgageFields);//Create ApplicantFields element and append it to MortgageAppApplicantFields = myXMLDoc.createElement("ApplicantFields");MortgageApp.appendChild(ApplicantFields);//Create the PropertyPrice element - a child to Mortgage fieldsPropertyPrice = myXMLDoc.createElement("PropertyPrice");PropertyPrice.appendChild(myXMLDoc.createTextNode("900000"));MortgageFields.appendChild(PropertyPrice);//Create the DownPayment element - a child to Mortgage fieldsDownPayment = myXMLDoc.createElement("DownPayment");DownPayment.appendChild(myXMLDoc.createTextNode("100000"));MortgageFields.appendChild(DownPayment);//Create the Mortgage element - a child to Mortgage fieldsMortgage = myXMLDoc.createElement("Mortgage");Mortgage.appendChild(myXMLDoc.createTextNode("800000"));MortgageFields.appendChild(Mortgage);//Create the Term element - a child to Mortgage fieldsTerm = myXMLDoc.createElement("Term");Term.appendChild(myXMLDoc.createTextNode("20"));MortgageFields.appendChild(Term);//Create the InterestRate element - a child to Mortgage fieldsInterestRate = myXMLDoc.createElement("InterestRate");InterestRate.appendChild(myXMLDoc.createTextNode("6.0"));MortgageFields.appendChild(InterestRate);//Create the LastName element - a child to ApplicantFields fieldsLastName = myXMLDoc.createElement("LastName");LastName.appendChild(myXMLDoc.createTextNode("White"));ApplicantFields.appendChild(LastName);//Create the FirstName element - a child to ApplicantFields fieldsFirstName = myXMLDoc.createElement("FirstName");FirstName.appendChild(myXMLDoc.createTextNode("Sam"));ApplicantFields.appendChild(FirstName);//Create the PhoneNumber element - a child to ApplicantFields fieldsPhoneNumber = myXMLDoc.createElement("PhoneNumber");PhoneNumber.appendChild(myXMLDoc.createTextNode("555-5555"));ApplicantFields.appendChild(PhoneNumber);//Create the SSN element - a child to ApplicantFields fieldsSSN = myXMLDoc.createElement("SSN");SSN.appendChild(myXMLDoc.createTextNode("123456678"));ApplicantFields.appendChild(SSN);return myXMLDoc;}}}
| Programming with LiveCycle ES (LiveDocs) |
| Adobe LiveCycle ES Update 1 |
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000006.html