How to configure the alfresco to run a script-task - runtime-error

I am trying to run a script task in alfresco process services, while compiling the script there were some error throw out in the console as like:
the console couldn't run 'javascript'
var x=5;
var y=5;
var xy=x*y;
document.write("The result is"+xy);
I expect the result as 25 that could be print in the console after the compilation of the script. Can anyone help me to resolve the issue?

Where/how are you running that code? Do you have a concrete error?
Most probably the "document" gets recognized as a root object, so the "write" method fails. If my theory is true, simply commenting that line out or replacing it with "logger" (another root object) will solve the issue.
https://docs.alfresco.com/4.1/references/API-JS-rootscoped.html
EDIT:
Now I realize you specified a Script Task.
I believe my theory is still relevant, however, root objects available are not the same.
https://docs.alfresco.com/5.1/references/API-JS-WorkflowService.html

Related

importance of do_build function in bitbake

I am new to bitbake and i am trying to learn it.
I am going through below link for getting a basic understanding
https://a4z.gitlab.io/docs/BitBake/guide.html
Here either through inheritance or directly i see a do_build is always executed.
this might seem a basic question but your answer would really help me.
I read a line like this "build is the task BitBake runs per default if no other task is specified".
Does it mean build is mandatory in bitbake.Is it like main function in c and c+= codes?
Thanks
When no task is specified on the commandline to bitbake, "build" is assumed. This can be overridden with the BB_DEFAULT_TASK variable to some other task. If a task isn't defined and you try and run it, an error will occur that the task can't be found. As such, a build task isn't absolutely required but you will likely run into errors without it in most common usages.

How can we redirect 'RobotTempDir' folder to save at different location on windows 10?

I am working with Robot Framework using RED editor on Eclipse IDE. When i ran a Robot test case an error as shown in the screenshot has occurred
Upon tracing back my actions, I have noticed that RobotTempDir... got deleted from Temp folder. I restored that folder and ran the test case. Then it executed successfully.
In future there are chances that while cleaning temp folder contents, RobotTempDir... may get deleted unknowingly. Is there a way to redirect this RobotTempDir... contents to save in a different location?
I looked into the C:\Python36\Lib\site-packages\robot path and didn't find any files where i can change/update Robot temp folder details.
The TestRunnerAgent.py is not part of the Robot Framework application but instead comes with the RED plugin. It is part of their Robot Run functionality which allows it to retrieve information from Robot Framework while it is running.
This information is then displayed in the Eclipse Message Log panel or used when using the RED debugger functionality.
In my view this file is generated every time Eclipse is started and I think the only time this error would occur is when that file/folder is deleted while Eclipse is running. Restarting Eclipse should fix this.
TestRunnerAgent.py is custom listener which is attached to Robot process to report back to RED what is happening during test execution. For normal test runs,this is Execution View information,also Message Log stuff printed there. For Debug run, TestRunnerAgent.py allows to control execution process (breakpoint stop,stepping) and changing internals of Robot (state of variables).
It is embedded in RED package,and as you said, it is temporary placed in Temp dir for execution. If you would like to check source,either check jar file: org.robotframework.ide.core-functions-0.0.1-SNAPSHOT.jar or on GitHub: https://github.com/nokia/RED/tree/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts
Back to your issue:
RED starts Robot execution with following command:
<selected python interpreter> -m robot.run --listener <path to TestRunnerAgent.py> <details what to run and other miscs>
There is no indication of error such error in TestRunnerAgent.py although there is in RobotLaunchConfigurationDelegate.java which tries to start Robot using interpreter in current Project configuration. I assume that there is something wrong in your env setup (either in RED or in OS)
I would suggest to check following:
check if you selected proper python interpreter with installed Robot (from Windows->Preferences-> RobotFramework ->Interpreters
check if your project looks similar as here: http://nokia.github.io/RED/help/user_guide/quick_start.html
you can try to use custom script to catch robot execution command and remove --listener part to validate if this is the culprit: http://nokia.github.io/RED/help/user_guide/launching/local_launch_scripting.html
there should be command in Console View - try to run it by yourself

Exception occured while invoking remote Soa service by httpClient

My IDE is IDEA Intellij.
By this IDE i run the program directly and get the right response successfully.
Now i build this program to a jar file by IDEA,
and i run the jar file in windows command line by:
java -jar XXX.jar
then error occurred in a line which looks like impossible to see error.
eg:in the line which defines a parameter etc.
I don't know exactly what case this error,just the ways of run the program are different.By the way i can't update the source code which i invoke by jar file.
When you run your app in IDEA, look for the "Run" tab that opens.
The first line there tells you exactly how Intellij has launch the app (just click on the full line to see if it is truncated with "..." ):
Java executable used
(some parameters set by Intellij you don't need to worry about)
(tons of classpath items you don't need to worry about)
the main class used
the program parameters used.
I am pretty sure that if you use these information to build your command line, it will succeed. The main class may be different than the one used by running your app with "java -jar" or some arguments may differ or be missing.

Can I build a debug version of an Adobe AIR application?

I'm trying to debug an issue on a clients machine. The problem is that the problem is a runtime error with very little clue as to where it is. It is an intermittent problem. I know ADL allows me to run the application in a debug mode. The problem is that to tell the user to download and manage the ADL invokation is going to be very difficult. It would be a lot easier if I could just give the end user one install/executable to install and run and then send me the trace of the issue. So what I'm looking for is easy steps for the client to be able to run the AIR app in debug mode. Downloading ADL and finding the install location of the app is going to be difficult to manage remotely with the end user.
Update:
You have to make sure you are working with AIR 3.5 and Flash 11.5 and also include the following flag "-swf-version=18" in additional compiler settings. You then have to catch the global error as mentioned in the answer and it will show you the location of the error. No line numbers of course. Just routine names. Thanks a milion to Lee for the awsome answer.
not a direct answer but if you publish for AIR3.5 (or 3.6 beta), you can get some debug info:
add a listener for uncaught RTEs to top level of your app:
this.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, globalErrorHandler);
and grab debug info from error in listener:
function globalErrorHandler(event:UncaughtErrorEvent):void
{
var message:String;
//check for runtime error
if (event.error is Error)
message = (event.error as Error).getStackTrace();
//handle other errors
else if (event.error is ErrorEvent)
message = (event.error as ErrorEvent).text;
else
message = event.error.toString();
//do something with message (eg display it in textfield)
myTextfield.text = message;
}
getStackTrace will return a stack trace even for release AIR apps (as long as you use AIR3.5 or above).
Without the SDK Tools; I don't think it is possible to run an aIR app in debug mode. But, here are a few alternatives to consider:
The client must have some idea what is going on to cause the error, right? Can you give them a special build with Alert Boxes or logging or something to help isolate the error to a line of code?
Can you listen for the uncaughtException event? The event will give you the full stack trace ( Error.getStackTrace() ); which you could then log--possibly with other information. Then you just have to tell your client to "Go here" and "send me this file." Or even display the info in some Alert and have the user copy and paste it into an email to you. More info on uncaughtException here and here
check my post. Maybe it helps you to get stack trace with line numbers in a AIR release build.
How can I get stacktrace for Adobe AIR global runtime errors in non-debug mode?
I use it in 2 big projects right now and it works very well.
Greetings

How do I change what Rational Functional Tester logs?

Recently my company upgraded from RFT 8.1.1.1 to RFT 8.2 and now all of our rational_ft_log.txt files that get generated from tests are at least a dozen times longer than they were before we upgraded.
These files are so much longer now because every little "getProperty on frame" that happens returns a +++Pass, like this:
++ PASS 30-Mar-2011 11:15:43.113 AM getProperty on the Frame
line_number = 50
script_name = DebugCommands.IR2_18_DebugCommands
Anyone know how to get rid of these nasty things?
I have searched exhaustively for RFT options to change, and I have looked a little into writing a plugin to output log files. I can't seem to get IBM to get back to me.
You could write your own plugin, or just create your own custom logging methods in a super helper class. I do that anyway, to give me flexibility to output my logging info to any destination. But to answer your specific question about getting rid of the extraneous getProperty log messages, see the RFT info center:
Logged events such as verification
point failures, script exceptions,
object recognition warnings, and other
additional playback information are
displayed in the playback log results.
From Rational® Functional Tester
version 8.2 and later, the results of
the getProperty() command are also
displayed in the log results. If you
do not require the log event to be
displayed in the playback log, you can
disable the event in the log results.
Before you begin: Ensure that you have
access to modify the ivory.properties
file.
About this task: To disable the
getProperty() log event, you must
modify the ivory.properties file.
Procedure: Open the ivory.properties
file available in the \Functional
Tester\bin\ directory. Add the
following line of code at the end of
the file
contents:rational.test.ft.log.enhanced=false
The fix is available under PMR29716. However, you would have to upgrade RFT8.2 to RFT 8.2.0.1 iFix01 to see it working.
Check the PMR # https://www-304.ibm.com/support/docview.wss?rs=0&uid=swg24029194

Resources