<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: ËÎÌå, sans-serif;"><div style="color: rgb(0, 0, 0);">Hi, everyone:</div><div style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space:pre">        </span>I added a button on the Template Tab, in the client side, It&#8217;s OK,</div><div style="color: rgb(0, 0, 0);"><img src="cid:871E2E8A-B375-456F-B2CF-9E25AB718A23" type="image/png"></div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">Added the button&#8217;s callback like this:</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);">&nbsp;private void backup()</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; BackupInfoParameters param = new BackupInfoParameters();</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; Frontend.RunAction(VdcActionType.Unknown, param, new IFrontendActionAsyncCallback() {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @Override</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public void executed(FrontendActionAsyncResult result) {</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; });</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">The BackupInfoCommand.java is :</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);">package org.ovirt.engine.core.bll;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">import org.ovirt.engine.core.bll.utils.PermissionSubject;</div><div style="color: rgb(0, 0, 0);">import org.ovirt.engine.core.common.action.BackupInfoParameters;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">import java.io.IOException;</div><div style="color: rgb(0, 0, 0);">import java.util.Collections;</div><div style="color: rgb(0, 0, 0);">import java.util.List;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">/**</div><div style="color: rgb(0, 0, 0);">&nbsp;* Created by leaboy on 8/7/14.</div><div style="color: rgb(0, 0, 0);">&nbsp;*/</div><div style="color: rgb(0, 0, 0);">public class BackupInfoCommand &lt;T extends BackupInfoParameters&gt; extends CommandBase&lt;T&gt;{</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; public BackupInfoCommand(T parameters){</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; super(parameters);</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; @Override</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; public List&lt;PermissionSubject&gt; getPermissionCheckSubjects() {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; return Collections.emptyList();</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; @Override</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; protected boolean canDoAction() {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; return true;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; @Override</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; protected void executeCommand() {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; int a;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; a = 1;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; try{</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Runtime.getRuntime().exec("touch /tmp/tmp.txt");</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; }catch (IOException e){</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);">}</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">And the BackupInfoParameters.java is:</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);">package org.ovirt.engine.core.common.action;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">/**</div><div style="color: rgb(0, 0, 0);">&nbsp;* Created by leaboy on 8/7/14.</div><div style="color: rgb(0, 0, 0);">&nbsp;*/</div><div style="color: rgb(0, 0, 0);">public class BackupInfoParameters extends VdcActionParametersBase implements java.io.Serializable{</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; private static final long serialVersionUID = -1363077467684414051L;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; private VdcActionType _actionType;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; //public BackupInfoParameters(){}</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; public BackupInfoParameters(){_actionType = VdcActionType.Unknown;}</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; public VdcActionType getActionType() {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; return _actionType;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);">}</div><div style="color: rgb(0, 0, 0);">=======================================================================</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">Built the code success, but when I clicked the button, got a dialog with the error info:</div><div style="color: rgb(0, 0, 0);"><br></div><div><b><font color="#ff2600">Error while executing action: A Request to the Server failed with the following Status Code: 500</font></b></div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">I debug it , find the error is raised at :</div><div style="color: rgb(0, 0, 0);"><br></div><div><div style="color: rgb(0, 0, 0);">protected VdcReturnValueBase evaluateCorrelationId(CommandBase&lt;?&gt; commandBase) {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; VdcReturnValueBase returnValue = null;</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; // Evaluate and set the correlationId on the parameters, fails on invalid correlation id</div><div>&nbsp; &nbsp; &nbsp; &nbsp;<b> <font color="#ff2600">returnValue = ExecutionHandler.evaluateCorrelationId(commandBase.getParameters());</font></b></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; if (returnValue != null) {</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log.warnFormat("CanDoAction of action {0} failed. Reasons: {1}", commandBase.getActionType(),</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StringUtils.join(returnValue.getCanDoActionMessages(), ','));</div><div style="color: rgb(0, 0, 0);"><br></div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; // Set the correlation-id on the command</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; commandBase.setCorrelationId(commandBase.getParameters().getCorrelationId());</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp; return returnValue;</div><div style="color: rgb(0, 0, 0);">&nbsp; &nbsp; }</div></div></body></html>