Skip navigation
Currently Being Moderated

How to return a html repsonse after form guide rendering in browser?

Nov 29, 2010 5:36 AM

How to return a html repsonse after form guide rendering in browser indicating that server has recieved transmission and request is submitted succesfuly?

 

I am rendering the form guide in browser using guide invoke service and when i submit the data in browser to server through guide , it is displaying some random number in browser?

 

i need to display a resposne that request is submitted successfully?

 
Replies
  • Currently Being Moderated
    Nov 29, 2010 6:00 AM   in reply to rohsin47

    Make sure the process that the guide submits to has an output variable of type document. Then populate that variable with html data.

     

    Jasmi

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2010 5:46 AM   in reply to rohsin47

    how could i define a variable with "html data" ?

     

    Create a variable of type document and then a service to read the html from where ever it's located. If you put it in LiveCycle, you can use the ReadRessource service. If it's on the file system, you can use the Read Document. If it's in the database, you can use the JDBC service.

     

     

    Also, one more doubt where should i use this variable in my process to get the same?

     

    You want the response once you've submitted the data, so the html is really the result of calling the process that's processing the data. So I would create an output variable of type document on that process.

     

    Right now it displays a random number in the browser because your submit process is long lived. When a process is long lived (asynchronous), you invoke it and then you get an identifier back. It's kind of a fire and forget. You can use that identifier to check the status of the long lived process, since long lived processes can take hours, days to complete. You don't want your browser to wait that long, hence the identifier.

     

    However if you change the process to be short lived (synchronous), the browser will wait for the result of the process, which really means the output variables for that process. If your output variable contains html, it'll display html.

     

    So the key is make you submit process short lived and populate the output variables appropriately.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2010 5:49 AM   in reply to Jasmin Charbonneau

    Something's wrong with the forum. I'm pasting your post here again.

     

    Thanks a lot Jasmi for your reply. But i m still not able to achive the desired result.

     

    how could i define a variable with "html data" ? do i have to import html page into my LC application and then attach the page to the varibale , or is there any other way?

     

    Also, one more doubt where should i use this variable in my process to get the same?

     

    Let me elaborate my application. that might helpful for you. I have two processes, one guide, one form and some other assets, Now my first process is just a guide invoke process which involves guide rendering as html in browser. and other second process is the main proocess which is processing the data captured via guide in browser.

    Now my Front end UI is calling the first process through a REST endpoint and opening the guide to let user enters the data in a step by step process. After user press the submit button in guide to submit the order, it is displaying some random number in browser. which i m not able to control. I want here to display a message " that order is submiitted succesfully.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 30, 2010 5:49 AM   in reply to Jasmin Charbonneau

    how could i define a variable with "html data" ?

     

    Create a variable of type document and then a service to read the html from where ever it's located. If you put it in LiveCycle, you can use the ReadRessource service. If it's on the file system, you can use the Read Document. If it's in the database, you can use the JDBC service.

     

     

    Also, one more doubt where should i use this variable in my process to get the same?

     

    You want the response once you've submitted the data, so the html is really the result of calling the process that's processing the data. So I would create an output variable of type document on that process.

     

    Right now it displays a random number in the browser because your submit process is long lived. When a process is long lived (asynchronous), you invoke it and then you get an identifier back. It's kind of a fire and forget. You can use that identifier to check the status of the long lived process, since long lived processes can take hours, days to complete. You don't want your browser to wait that long, hence the identifier.

     

    However if you change the process to be short lived (synchronous), the browser will wait for the result of the process, which really means the output variables for that process. If your output variable contains html, it'll display html.

     

    So the key is make you submit process short lived and populate the output variables appropriately.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 1, 2010 5:22 AM   in reply to rohsin47

    that i can do and it will have a html output stored in variable , but how would i display that variable output in a browser to a user?

     

    A process is like a service. When you call it you get a response (output variables). The browser is going to try to display the output variable a best it can. If it's html, the it shouldn't have any problem displaying the result from the process.

     

    Now here i got why it is displaying random number and what is its  significance but i can't change my process to short live as it contains  task assignments to certain people . So, what is the other way around?

     

    If you want a response, you'll have to call a short lived process. You could call a short lived process to receive your submission and return html, then use the WebService service to invoke a long lived process to do the user assignment.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2010 6:04 AM   in reply to rohsin47

    I still think web service is the way to go.

     

    Other than that you can create a custom component that will invoke the process through the java api, or write a custom component that will invoke it using REST.

     

    Now back to the web service. When you configure it, make sure to use the invoke_asynch instead of invoke. That way it'll call it and not wait for a response.

     

    Then on the Request tab, click on the Generate button for the SOAP Request to generate a sample request message. You might also want to click on Remove'?' to remove the '?' from the request if you're not replacing them with actual values.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 6, 2010 5:18 AM   in reply to rohsin47

    You don't change the endpoint.

     

    When you create a process you automatically get a SOAP endpoint. The soap endpoint comes with 5 different methods: Invoke, Invoke_Async, Invoke_Dispose, Invoke_Result and Invoke_Status.

     

    You can any of the operation. You would need to specify the operation with the client you're using to make the web service call.

     

    How are you testing it?

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 7, 2010 5:23 AM   in reply to rohsin47

    Let's say you have two processes.

     

    1- Calling process

    This is the process that contains the web service and is short lived.

     

    2- Other process

    This is the process that has to be long lived because it contains User steps.

     

    When you use the Web Service service you can use either invoke or invoke_async. This is just the method the web service is going to call the the #2 process.

    If you use invoke, the web service step will wait for #2 to complete before getting a response. Therefore if #1 is short lived (meaning it returns a value when all steps are completed), it might take a while before it completes because it will have to wait for #2 to complete (and other steps).

     

    Now if you use invoke_async, it will call #2 and then get a response right away. which means your process #1 will terminate in a decent time.

     

    You don't' have to make the #1 process long lived because you use the invoke_async operation.

     

    You should only need two processes.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 10, 2010 7:31 AM   in reply to rohsin47

    We're going to get there!!!

     

    You're right when you say that you have to call Process 2 using invoke_asyn because it's long lived.

     

    Now let's understand what Process 1 (short lived) will do.

     

    1- You're going to invoke Process 1 synchronously using invoke because it's short lived.

    2- It will execute all the steps.

    3- When it gets to the web service step, it'll invoke the web service using invoke_async, and that step WILL receive a response immediately. You will get back an invocation id. Then as far as this step is concerned, it's completed.

    4- Then it'll go to whatever steps you have left and complete the process and return the response back to the caller.

     

    I think you're getting confused with using invoke_asyn in a short lived process. But it doesn't matter because you'll get a response from that step (invocation id)  and  you'll be able to complete the rest of your process. You're ont wainting for the long lived process to complete.

     

    I hope this clarifies it.

     

    I'm not sure how else to explain it .

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 14, 2010 5:26 AM   in reply to rohsin47

    "I want to tell you , this is not gonna happen, it will throw an exception, because,as i had told earlier, In short lived process, you will get only one operation method and i.e invoke( invoke synchronoulsy) ,"

     

    The process you're trying to call from the short lived process using the web service IS long lived. Therefore the web service operation WILL show you the four operations. The web service doesn't care in which process it's being used.

     

    In your case you use the web service operation in a short lived process to call a long lived process. So again the web service operation will show you the 4 operations.

     

    I honestly would like to help you more but I honestly don't know how else to explain it. If you don't understand again, I suggest you call support to talk to someone one the phone.

     

    The only thing I can tell you is that I did the exact same thing a few weeks ago and it worked, so I know this is definitely possible,

     

    Good luck.

     

    Jasmin

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 17, 2010 12:32 PM   in reply to rohsin47

    I'm going away on vacation for two weeks, so hopefully you'll be able to make sense of this.

     

    First the output variable has nothing to do with it. The output/input variables only affect the input/output parameters of the entire process. Basically what you're going to pass to the process and what the process is going to return.

     

    Now in your long lived process, it look like you have an input parameter of type XML.

     

    I see two ways to pass your XML in.

     

    1- Convert the XML into a base64 encoded string and change your input variable to a string. You'll have to decode the string back in the long lived process. LiveCycle has built-in function (in xPath) to do that.

    2- Pass your xml variable as an attachment to the SOAP request in a document variable. The reason we put it in an document variable is to avoid having xml (data) witinh xml (soap request). Otherwise you would need to wrap it between CData tags.

     

    In both cases, what you need to do is select the Generate Request button (and check Show Optional Parameter option).

     

    If you use a string, you need to replace the  ? with the xPath expression that contains the encoded xml string.

     

    If you use a document variable, it will fill the attachment id with a guid. Then you go on the Attachment tab, and associate the xPath expression for the document variable to the GUID that's in the SOAP request.

     

    I'm writing this all from memory because my servers are down. So excuse me if the terminology is not exactly the same.

     

    Jasmin

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points