本文整理了Java中org.opencastproject.workflow.api.WorkflowInstance.getState()
方法的一些代码示例,展示了WorkflowInstance.getState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowInstance.getState()
方法的具体详情如下:
包路径:org.opencastproject.workflow.api.WorkflowInstance
类名称:WorkflowInstance
方法名:getState
[英]The current WorkflowState of this WorkflowInstance.
[中]
代码示例来源:origin: opencast/opencast
/**
* {@inheritDoc}
*
* @see org.opencastproject.workflow.api.WorkflowListener#stateChanged(org.opencastproject.workflow.api.WorkflowInstance)
*/
@Override
public void stateChanged(WorkflowInstance workflow) {
synchronized (this) {
if (!workflowInstanceIds.isEmpty() && !workflowInstanceIds.contains(workflow.getId()))
return;
WorkflowState currentState = workflow.getState();
if (!notifyStates.isEmpty() && !notifyStates.containsKey(currentState))
return;
if (notifyStates.containsKey(currentState)) {
notifyStates.get(currentState).incrementAndGet();
}
total.incrementAndGet();
logger.debug("Workflow {} state updated to {}", workflow.getId(), workflow.getState());
notifyAll();
}
}
代码示例来源:origin: opencast/opencast
/**
* Gets a notification message with placeholders and substitute them with corresponding meta-data of workflowInstance.
* The resulting String is transformed to a Json-String
*
* @param s The notification message to transform to Json-String
* @param workflowInstance The workflowInstance which getting metadata from
* @return JSON-String containing the information of the workflowInstance
*/
private String makeJson(String s, WorkflowInstance workflowInstance) {
s = s.replace("%t", checkIfNull(workflowInstance.getTitle(), "Title"));
s = s.replace("%i", String.valueOf(workflowInstance.getId()));
s = s.replace("%s", String.valueOf(workflowInstance.getState()));
s = s.replace("%o", String.valueOf(workflowInstance.getCurrentOperation().getId()));
s = s.replace("%I", checkIfNull(workflowInstance.getMediaPackage().getIdentifier(), "Mediapackage-ID"));
s = s.replace("%T", checkIfNull(workflowInstance.getMediaPackage().getTitle(), "Mediapackage-Title"));
s = s.replace("%c", checkIfNull(workflowInstance.getMediaPackage().getContributors(), "Contributors"));
s = s.replace("%C", checkIfNull(workflowInstance.getMediaPackage().getCreators(), "Creators"));
s = s.replace("%D", checkIfNull(workflowInstance.getMediaPackage().getDate(), "Date"));
s = s.replace("%d", checkIfNull(workflowInstance.getMediaPackage().getDuration(), "Duration"));
s = s.replace("%l", checkIfNull(workflowInstance.getMediaPackage().getLanguage(), "Language"));
s = s.replace("%L", checkIfNull(workflowInstance.getMediaPackage().getLicense(), "License"));
s = s.replace("%S", checkIfNull(workflowInstance.getMediaPackage().getSeriesTitle(), "Series-Title"));
JsonObject json = new JsonObject();
json.addProperty("text", s);
return gson.toJson(json);
}
内容来源于网络,如有侵权,请联系作者删除!