當前位置: 首頁>>代碼示例>>Java>>正文


Java InputStepExecution類代碼示例

本文整理匯總了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;
	}
}
 
開發者ID:jenkinsci,項目名稱:openshift-sync-plugin,代碼行數:20,代碼來源:BuildSyncRunListener.java

示例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;
		}
	}
}
 
開發者ID:ThoughtsLive,項目名稱:hubot-steps,代碼行數:32,代碼來源:ApproveStep.java


注:本文中的org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。