org.opencastproject.workflow.api.WorkflowOperationInstance.getId()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.opencastproject.workflow.api.WorkflowOperationInstance.getId()方法的一些代码示例,展示了WorkflowOperationInstance.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowOperationInstance.getId()方法的具体详情如下:
包路径:org.opencastproject.workflow.api.WorkflowOperationInstance
类名称:WorkflowOperationInstance
方法名:getId

WorkflowOperationInstance.getId介绍

[英]Gets the unique identifier for this operation, or null.
[中]获取此操作的唯一标识符,或null。

代码示例

代码示例来源:origin: opencast/opencast

  1. /**
  2. * Gets a notification message with placeholders and substitute them with corresponding meta-data of workflowInstance.
  3. * The resulting String is transformed to a Json-String
  4. *
  5. * @param s The notification message to transform to Json-String
  6. * @param workflowInstance The workflowInstance which getting metadata from
  7. * @return JSON-String containing the information of the workflowInstance
  8. */
  9. private String makeJson(String s, WorkflowInstance workflowInstance) {
  10. s = s.replace("%t", checkIfNull(workflowInstance.getTitle(), "Title"));
  11. s = s.replace("%i", String.valueOf(workflowInstance.getId()));
  12. s = s.replace("%s", String.valueOf(workflowInstance.getState()));
  13. s = s.replace("%o", String.valueOf(workflowInstance.getCurrentOperation().getId()));
  14. s = s.replace("%I", checkIfNull(workflowInstance.getMediaPackage().getIdentifier(), "Mediapackage-ID"));
  15. s = s.replace("%T", checkIfNull(workflowInstance.getMediaPackage().getTitle(), "Mediapackage-Title"));
  16. s = s.replace("%c", checkIfNull(workflowInstance.getMediaPackage().getContributors(), "Contributors"));
  17. s = s.replace("%C", checkIfNull(workflowInstance.getMediaPackage().getCreators(), "Creators"));
  18. s = s.replace("%D", checkIfNull(workflowInstance.getMediaPackage().getDate(), "Date"));
  19. s = s.replace("%d", checkIfNull(workflowInstance.getMediaPackage().getDuration(), "Duration"));
  20. s = s.replace("%l", checkIfNull(workflowInstance.getMediaPackage().getLanguage(), "Language"));
  21. s = s.replace("%L", checkIfNull(workflowInstance.getMediaPackage().getLicense(), "License"));
  22. s = s.replace("%S", checkIfNull(workflowInstance.getMediaPackage().getSeriesTitle(), "Series-Title"));
  23. JsonObject json = new JsonObject();
  24. json.addProperty("text", s);
  25. return gson.toJson(json);
  26. }

代码示例来源:origin: opencast/opencast

  1. operation.getId(), mediaPackage.getIdentifier());
  2. saveOrLog(MediaPackageParser.getAsJSON(mediaPackage), directory, filename);
  3. operation.getId(), mediaPackage.getIdentifier());
  4. saveOrLog(MediaPackageParser.getAsXml(mediaPackage), directory, filename);
  5. String filename = String.format("workflow-%d-%d.xml", workflowInstance.getId(), operation.getId());
  6. try {
  7. saveOrLog(WorkflowParser.toXml(workflowInstance), directory, filename);

代码示例来源:origin: opencast/opencast

  1. @Override
  2. public IncidentTree getIncidentsOfJob(long jobId, boolean cascade) throws NotFoundException, IncidentServiceException {
  3. List<Incident> incidents = getIncidentsOfJob(jobId);
  4. List<IncidentTree> childIncidents = new ArrayList<IncidentTree>();
  5. try {
  6. Job job = getServiceRegistry().getJob(jobId);
  7. if (cascade && !"START_WORKFLOW".equals(job.getOperation())) {
  8. childIncidents = getChildIncidents(jobId);
  9. } else if (cascade && "START_WORKFLOW".equals(job.getOperation())) {
  10. for (WorkflowOperationInstance operation : getWorkflowService().getWorkflowById(jobId).getOperations()) {
  11. if (operation.getState().equals(OperationState.INSTANTIATED))
  12. continue;
  13. IncidentTree operationResult = getIncidentsOfJob(operation.getId(), true);
  14. if (hasIncidents(Collections.list(operationResult)))
  15. childIncidents.add(operationResult);
  16. }
  17. }
  18. return new IncidentTreeImpl(incidents, childIncidents);
  19. } catch (NotFoundException ignore) {
  20. // Workflow deleted
  21. return new IncidentTreeImpl(incidents, childIncidents);
  22. } catch (Exception e) {
  23. logger.error("Error loading child jobs of {}: {}", jobId);
  24. throw new IncidentServiceException(e);
  25. }
  26. }

相关文章