简体   繁体   English

检查工作流程完成情况的查询是什么?

[英]what will be the query for check completion of workflow?

I have to cheack the status of workflow weather that workflow completed within scheduled time or not in sql query format.我必须以 sql 查询格式检查工作流天气的状态,工作流是否在预定时间内完成。 And also send an email of workflow status like 'completed within time ' or not 'completed within time'.并且还发送工作流状态的 email,例如“在时间内完成”或“未在时间内完成”。 So, please help me out所以,请帮帮我

You can do it either using option1 or option 2.您可以使用选项 1 或选项 2 来完成。

  1. You need access to repository meta database.您需要访问存储库元数据库。
  • Create a post session shell script.创建一个帖子 session shell 脚本。 You can pass workflow name and benchmark value to the shell script.您可以将工作流名称和基准值传递给 shell 脚本。
  • Get workflow run time from repository metadata base.从存储库元数据库获取工作流运行时间。 SQL you can use - SQL 你可以使用 -
SELECT WORKFLOW_NAME,(END_TIME-START_TIME)*24*60*60 diff_seconds
FROM 
REP_WFLOW_RUN
WHERE WORKFLOW_NAME='myWorkflow'
  • You can then compare above value with benchmark value.然后,您可以将上述值与基准值进行比较。 Shell script can send a mail depending on outcome. Shell 脚本可以根据结果发送邮件。
  • you need to create another workflow to check this workflow.您需要创建另一个工作流程来检查此工作流程。
  1. If you do not have access to Metadata, please follow above steps except metadata SQL.如果您无权访问元数据,请按照上述步骤操作,元数据 SQL 除外。 Use pmcmd GetWorkflowDetails to check status, start and end time for a workflow.使用 pmcmd GetWorkflowDetails检查工作流的状态、开始和结束时间。
pmcmd GetWorkflowDetails -sv service -d  domain -f folder myWorkflow

You can then grep start and end time from there, compare them with benchmark values.然后,您可以从那里开始和结束时间 grep,将它们与基准值进行比较。 The problem is the format etc. You need little bit scripting here.问题是格式等。你需要一点点脚本在这里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM