Quantcast
Viewing all articles
Browse latest Browse all 4841

Re: Image in PDF using xsl-fo

Are you sure that the custom action code is not swalowing the exception and hiding the error from you?  If you have an uncaught exception when the action finishes this will also appear in the Execution Logger Trace window when the transaction finishes.

 

If you use System.out.println("") it will always write the string value to the NetWeaver Java logs and if you use this code it will appear in the Execution Logger Trace too:

// This annotation tells the engine that this is an action available to execute.

@Action(name = "ExecuteACommand", icon = "/com/sap/mii/custom/actions/filerunner/icons/scroll_run.png")

// This annotation tells the engine that an XML output called 'Output' is going to be returned.

// The possible ExitValue codes are: 0 for async/successful, -1 for failed, and anything else is tied to the runtime thread exit code

@Outputs(names = { Output, OutputErr, ExitValue}, types = { VariantDataTypes.STRING, VariantDataTypes.STRING, VariantDataTypes.INTEGER })

// This annotation tells the engine that this is the Java Swing class that defines the design time action configuration dialog

@ConfigurationDialog(dialogClass = FileRunnerDialog.class, localizationType = ConfigurationDialogLabelLocalizationType.BUILT_IN)

public static void executeACommand(

// Besides the basic types, the IActionInstance interface is the only other type allowed to be

// defined in parameter list of a custom action.

IActionInstance inst,

// @Input annotations are used to indicate the user modifiable inputs to this action.

@Input(name = Command,   defaultValue = "") String command,

@Input(name = InputArgs, defaultValue = "") String args,

@Input(name = AsyncProc, defaultValue = "true") boolean procAsync,

@Input(name = Trace,     defaultValue = "false") boolean trace)

// Exceptions can be thrown directly from the actions without causing critical execution failures.

// These exceptions will be caught and logged by the engine and will cause the Success flag to be set to false.

throws InvalidVariableException {

     Process p = null;

     BufferedReader bri = null;

     BufferedReader bre = null;

     String outputText = ""; String errorText  = "";

     try {

          // Verify that there is a command to run

          if(command != "") {

               if(trace) {

                    inst.log( LogLevel.INFO, "Command is: "+command+" "+args); }

......

 

 

Where using the instance of the action, hooks back to the runtime engine, you can generate execution trace messages that print out various informaitonal, warning, error, or fatal level messages.  The LogLevel class specifies the severity and you can see the enitre action code in the above snippet in this document here:

File Runner Custom Action

 

Hope this helps,

Sam


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>