As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Can you post the actual code you used, also where are the files, and what happened when you used the code, did it delete all the files, or none, or some ?
I have the above mentioned files in the path that i have used in the properties and I just built a pflow which includes this FILE(FileOperations)object and ran in the designer, It runs successfully,but it didn't delete the files.
Hi Gopal, I suspect that File (from) doesn't accept wild cards. I'm not certain, and can't find anything in the doco.
Have you tried the XDRunCmdAgent? You can issue any command line command from a service object using this. Search info centre for 'run command agent' for details.
But when I execute a simple p-flow with the service XDRunCmdAgent and with the command mentioned by you del D:\XX_Gopal\GK\FilesDelete\*z.txt,
P-flow fails to execute with the error, error : Detected problem in agent execute: java.io.IOException: CreateProcess: del D:\XX_Gopal\GK\FilesDelete\*z.txt error=2
Hi Gopal, This works fine for me if I use an SREG to hold the command I'm issuing... set an SREG to have the value: del D:\XX_Gopal\GK\FilesDelete\*z.txt
Then reference that SREG in your XDRunCmdAgent property runcmd.cmd.label. I left all other properties of the agent as default - platform, false, false, 0, false, false.
Even I tried giving the exact file path and this also giving me the same error.
del D:\XX_Gopal\GK\FilesDelete\File3.txt
Service object :-- run variable holds the value del D:\XX_Gopal\GK\FilesDelete\File3.txt.
RunCmdAgent object uses this SREG(run)in runcmd.cmd.label property and all others being default.
This is what the error that I am getting,
error status="1">
<msg>Exception returned from OS</msg>
<exception type="java.io.IOException">
<emsg>Cannot run program "del": CreateProcess error=2, The system cannot find the file specified</emsg>
P-flow is very simple,
I really dont know what is causing this error,is that to do with the access??? or because I am running the p-flow directly from the designer??
As of now I am executing a script directly from a command prompt,as it accepts the wild cards and have made this as a scheduled task.
-SET &APP = 'baseapp';
APP FI DELPROC DISK delproc.fex
APP QUERY &APP HOLD
TABLE FILE FOCAPPQ
PRINT COMPUTE APPDEL/A200 = 'APP DELETEFILE &APP "' | GETTOK(FILENAME,70,1,'.',70,'A70') || '" TXT';
WHERE FILENAME LIKE '%z.txt'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS DELPROC FORMAT ALPHA
END
-RUN
-IF &RECORDS EQ 0 THEN GOTO DONE;
EX DELPROC
-DONE
Change the &APP to the one of your choice. This is not OS specific and avoids explicit looping commands such as -REPEAT. Use the WHERE statement to select files for deletion. You can comment out the ON TABLE HOLD line to see the code being generated. Handle with care, you wouldn't want to accidentally wipe out a bunch of files.
WebFOCUS 8.2.06
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010
Hi, Silly question really, but can you issue the command 'del D:\XX_Gopal\GK\FilesDelete\File3.txt' from your command line? I'm thinking either you're not on windows, so DEL isn't the correct keyword for deleting files, or maybe it's a permissions problem? Can you try running your pflow from a listener/channel in iSM? I've seen plenty of differences between that and test running in designer in the past...
As the designer didn't work out,I am executing a script directly from a command prompt,as it accepts the wild cards and have made this as a scheduled task,that checks and deletes the files everyday.
Previously I was running the p-flow directly from designer,But I have to try the channel option.