How to make calls to http sites from groovy in Designer

  • KM03770072
  • 28-Dec-2020
  • 28-Dec-2020


Some times users need to make calls to http outside sites from the BF, here you will find the way as reference and an open groovy code.


 There isn’t documentation taking about it, some, groovy programming will take place in order to do that calls from the business flow, here you will find the way to do it.


 What are the versions being affected?
All versions

 How to show an example of that groovy?

1. Go to Designer
2. Do simple Model and cartridge without purse, just for this need and purposes.
3. Now to go Business Flow creation
4. Choose Groovy activity
5. Then there you would include bellow code
6. Just check it out and make adjustments on your needs
7. But having this you can understand how to handle it
8. This is only for reference, but, just like this, it works fine
9. Code is:

// Java program to demonstrate working of URL
import java.lang.Object;

public class URLclass1
public static void main(String[] args)
throws MalformedURLException
// creates a URL with string representation.
URL url1 =
new URL("" +
// creates a URL with a protocol,hostname,and path
URL url2 = new URL("http", "www.<yourhttpsitehere>.org",
URL url3 = new URL(""+
"q=gnu&rlz=1C1CHZL_enIN71" +
"4IN715&oq=gnu&aqs=chrome..69i57j6" +
"9i60l5.653j0j7&sourceid=chrome&ie=UTF" +
URL url4 = new URL("https://www.<yoursitehttphere>.com/index.html");
// print the string representation of the URL.
System.out.println("Different components of the URL3-");
// retrieve the protocol for the URL
System.out.println("Protocol:- " + url3.getProtocol());
// retrieve the hostname of the url
System.out.println("Hostname:- " + url3.getHost());
// retrieve the defalut port
System.out.println("Default port:- " +
// retrieve the query part of URL
System.out.println("Query:- " + url3.getQuery());
// retrive the path of URL
System.out.println("Path:- " + url3.getPath());
// retrive the file name
System.out.println("File:- " + url3.getFile());
// retrieve the reference
System.out.println("Reference:- " + url3.getRef());

// Yo metiendo mas aqui
System.out.println(" ++++++++++ GATO ++++++++");
// https://www.<yoursitehttphere>.com/index.html
"cmd /c \"start chrome https://www.<yoursitehttphere>.com/index.html\"".execute()
System.out.println(" ++++++++++ Fin ++++++++");


10. This is only a code FYReference.