Discussion

Creating WO By Reading A file

Hi All,

I have business scenario in which I have a csv(comma-separated file)in my local machine.The File has multiple rows of data,wherein each row is single record and each record has details like name,age etc.
I need to read this file and create a WO for each Record.

Is someone having any experience of this scenario?
Thanks in Advance

Avnish

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

July 29, 2011 - 6:57am

use Rule-Parse-Delimited rule which will help you to get the files contents in to PRPC

Once you have content in PRPC, you can do what ever you want with it :-) !!

-Bala

July 29, 2011 - 7:04am

Use File Listener too..

-- Bala

July 29, 2011 - 7:37am

Thanks Bala for instant reply,its really nice of you.
The solution you suggested would be appropriate when I am receiving the file from some other system or from server.My system is completely desolate from other systems.

I have the file to be parsed in one of my system's directories.
Kindly suggest some solution under such condition.

Regards,
Avnish

August 1, 2011 - 5:44am

quote:


I have the file to be parsed in one of my system's directories

Do you think having the file in System's Directory is sufficient to work on it without using FileListener and Rule-Parse-Delimited.

In my experience, we have to use the two rules to read the content from physical drive to Pega's Memory (Clipboard) to process further.

Please let me know if you have a different experience on the same.

--Bala

August 3, 2011 - 6:10am

Hi Bala,

I think this can be done using Activity alone although I have not succeed yet.I am struck at a point where I have to read the file from local directory and assign the whole content of the browsed file to a clipboard property.

I think this can be done using java.Once the property has the value, it can be parsed easily.

Thus I need the Code to assign the file content to clipboard property.

Please share the code if someone possess it.

Thanks in Advance

Regards,
Avnish

August 5, 2011 - 1:45am

Hi Bala,

I have Succeded in parsing the local file without using the File listener and File Service.

I have used only an activity and a harness rule to parse the file.The file data can be fetched and read using a java code and activity can be used for parsing the data as in the conventional approach.

Thanks,
Avnish

August 5, 2011 - 5:50am

This is classic example for violating the Pega'a Guardrails.

Nice dude.

--Bala

Pega
August 5, 2011 - 4:35pm

Pega
August 5, 2011 - 4:39pm

January 5, 2016 - 10:37am
Response to AVNISH243

Can you please share the code for reading local file.

 

Thanks,

Praveen