本文整理匯總了Java中org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution類的典型用法代碼示例。如果您正苦於以下問題:Java InputStepExecution類的具體用法?Java InputStepExecution怎麽用?Java InputStepExecution使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
InputStepExecution類屬於org.jenkinsci.plugins.workflow.support.steps.input包,在下文中一共展示了InputStepExecution類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPendingActionsJson
import org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution; //導入依賴的package包/類
private String getPendingActionsJson(WorkflowRun run) {
List<PendingInputActionsExt> pendingInputActions = new ArrayList<PendingInputActionsExt>();
InputAction inputAction = run.getAction(InputAction.class);
if (inputAction != null) {
List<InputStepExecution> executions = inputAction.getExecutions();
if (executions != null && !executions.isEmpty()) {
for (InputStepExecution inputStepExecution : executions) {
pendingInputActions.add(PendingInputActionsExt.create(inputStepExecution, run));
}
}
}
try {
return new ObjectMapper().writeValueAsString(pendingInputActions);
} catch (JsonProcessingException e) {
logger.log(SEVERE, "Failed to serialize pending actions. " + e, e);
return null;
}
}
示例2: start
import org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution; //導入依賴的package包/類
@Override
public boolean start() throws Exception {
final String room = Util.fixEmpty(step.getRoom()) == null ? envVars.get("HUBOT_DEFAULT_ROOM") : step.getRoom();
final URL buildUrl = new URL(envVars.get("BUILD_URL"));
ResponseData<Void> response = verifyCommon(step, listener, envVars);
final String message = "Job: " + buildUrl.toString() + "\n\n" + step.getMessage() + "\n" + "\tto Proceed reply: .j proceed " + buildUrl.getPath() + "\n"
+ "\tto Abort reply : .j abort " + buildUrl.getPath() + "\n";
if (response == null) {
logger.println("Hubot: ROOM - " + room + " - Approval Message - " + step.getMessage());
response = hubotService.sendMessage(room, message);
}
logResponse(response);
try {
final InputStep input = new InputStep(step.getMessage());
input.setId("Proceed");
final InputStepExecution inputExecution = (InputStepExecution) input.start(getContext());
return inputExecution.start();
} catch (final Exception e) {
if (failOnError) {
throw new AbortException("Error while sending message: " + e.getMessage());
} else {
return false;
}
}
}