Hi, I'm have a requirement to make a web service (or anything like that). The main point is: 1. Create folder based on date and time, on local machine (not the server) 2. Inside the folder will have a txt file Can anyone suggest how to achieve this requirement, thanks :D (Currently on Pega 7.2.2)
Pega doesn't provide any OOTB activity to achieve this. You will have to use Java here. You can create activity in Pega and put your java code there.
This will create a new folder with current timestamp:
Date now = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("hh mm ss");
String time = dateFormat.format(now);
File dir = new File(time);
But keep in mind, while using JAVA in a Pega activity, you will have to fully qualify all classes. If you are not aware of it then you can check the OOTB activities and the Java steps written in them.
However as you have mentioned, you want to create the file on the local machine. For this, you will have to first set up a communication protocol between the server and the local machine. This might help you:
Thanks for your reply.
I want ask another question based on your reply.
I'm already try to make a java step on activity and the folder created on server (which Pega place on that server). If we're want to create the communication protocol between server and the local machine, when and where we're try to make a server-client socket like you mention above?