如何触发从UI操作的ServiceNow的工作流程? [英] How to trigger ServiceNow workflow from ui action?

查看:1952
本文介绍了如何触发从UI操作的ServiceNow的工作流程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用中的ServiceNow的工作流程。我可以看到,在工作流程中的触发是基于的条件。但工作流通过某种用户操作的,即一个UI动作/按钮或通过脚本触​​发?

I am getting started with workflows in ServiceNow. I can see that the trigger for at workflow is based on conditions. But can a workflow be triggered by some sort of user action, i.e. a UI Action/button or through a script?

推荐答案

有一个工作流程对象,您可以用它来启动一个工作流程的<一个访问的服务器端href=\"http://wiki.servicenow.com/index.php?title=Workflow_Script#startFlow.28workflowId.2C_current.2C_operation.2C_vars.29\"相对=nofollow>这里记录。

There's a Workflow object accessible server side that you can use to start a workflow that's documented here.

下面是来自维基文章一个例子:

Here's an example from that wiki article:

// where current is a task record with a workflow context
var w = new Workflow();
var context = w.startFlow(id, current, current.operation(), vars);


  • 电流:这是一个GlideRecord 的next()主编的记录对你正在运行的工作流程

  • ID :的sys_id的要运行(注: wf_workflow :这不是工作流程的版本 startFlow 方法处理决定哪个版本的发表并执行反对它。

  • 瓦尔:你的目标的工作流程接受输入变量。这应该是一个JavaScript关联数组例如:
    VAR瓦尔= {变量1:值1,变量2:值2};

    • current: A GlideRecord that's been next()'ed to the record against which you're running the workflow
    • id: The sys_id of the wf_workflow you want to run (NOTE: This is NOT the workflow version, the startFlow method handles determining which version is published and executes against it.
    • vars: The input variables that your target workflow accepts. This should be a JavaScript associative array e.g.: var vars = {variable1: "value1", variable2: "value2"};
    • 这篇关于如何触发从UI操作的ServiceNow的工作流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆