官术网_书友最值得收藏!

Starting a workflow from a dialog

We have looked at workflows and dialogs. But they can function together to achieve a result. For example, we can start from a dialog, capture specific information, and then kick off a workflow as part of the same process to process the information and generate a result.

Getting ready

Using the same solution package, we will be creating two new processes. One is a workflow that sends an e-mail when a field value changes, which we will mark as a child process. The other is a dialog that will call this workflow.

How to do it...

Create the child workflow by performing the following steps:

  1. Create a new workflow, on the Account entity this time. Mark it to run as a child process.
    How to do it...
  2. Add a send e-mail step to the workflow, and configure the email properties as described in a previous recipe.
    How to do it...
  3. Activate the workflow.

Create the parent dialog that will kick-of this workflow by performing the following steps:

  1. Create the parent dialog on the same entity, as a dialog.
  2. Create a new page, then a question with a Yes/No option set. Create a new check condition step, in which if the value selected in the dialog is Yes, then create a Start Child Workflow step. Look up the child workflow we created earlier and select it.
    How to do it...
  3. Save and activate this dialog.

How it works...

The dialog we have created, as simple as it is, prompts the user to decide whether they want to run a workflow or not. When the user selects Yes, the workflow is started.

We can easily test this functionality by going to a new account, and selecting from the ribbon the Start Dialog button. A window prompts us to select the dialog we will run.

We can easily check the execution status of both the dialog and the workflow by navigating on the account to the Processes section.

These two views will give us details about the processes that run against the current account, and the status of each.

主站蜘蛛池模板: 集贤县| 洛浦县| 姚安县| 池州市| 卓尼县| 中牟县| 朝阳区| 杨浦区| 鹤壁市| 乐平市| 玉林市| 墨玉县| 邢台市| 万载县| 曲阜市| 古蔺县| 刚察县| 敦化市| 宁武县| 渝北区| 广昌县| 津南区| 江油市| 汉川市| 兴和县| 安龙县| 大兴区| 平陆县| 荆门市| 广南县| 喜德县| 图片| 屏南县| 叙永县| 广饶县| 镇安县| 商丘市| 吴旗县| 吐鲁番市| 太仆寺旗| 肥城市|