It's all about the answers!

Ask a question

To Create File on Desktop using Doors DXL OSLC service.


Pranav Sonawame (111) | asked Feb 14, 3:55 a.m.
edited Feb 14, 4:13 a.m.

Hello everyone,

I am facing an issue while trying to create a .txt file on the desktop using Doors DXL OSLC services called through a Python API. Below is the DXL code I am using:

pragma encoding, "UTF-8"
pragma runLim, 0  // No limit
noError

string getPath = (getenv("USERPROFILE"))"\\Desktop\\Export.txt"
Stream outputfile = write(getPath, CP_UTF8);
void getHelloString(string inputText)
{
   
    outputfile << inputText
   
    close(outputfile)
    setDxlServiceResult "Done"
    

}

The API output returns <doors:result rdf:parseType="Literal">Done</doors:result> , indicating that the API is running successfully. However, the .txt file is not being created on the desktop.

Is there any way to create a .txt file on the desktop using OSLC services in Doors DXL?

I appreciate any insights or suggestions on how to resolve this issue.

Thank you!

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Feb 14, 5:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I don't have the slightest idea of how DXL works and what is syntax is. However, I think, if you set the service result to done without checking if your DXL operation actually worked, you should not expect anything other than what you see. 

I found this about error handling in file operations in DXL: https://www.ibm.com/docs/en/cobol-zos/6.4?topic=errors-handling-in-input-output-operations

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.