`
evangxli
  • 浏览: 230175 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

转 How to Trigger Class based workflow

 
阅读更多

How to Trigger Class based workflow

By Rakesh Dhudipala from Link

 

Scenario:

This explains a simple scenario to trigger Class based Workflow from program.  

Step by Step procedure:  

Go to SE24 transaction and create a class with ZCL_WEBDYNPRO_WF.

Go to Interfaces tab and implement the interface IF_WORKFLOW

Go events tab and create a event trigger with parameter i_kunnr.


Go to methods tab and and implement the SET_CUTOMER method with I_KUNNR as importing parameter.

Set_customer method write the below code.  

method set_customer.

* Data Declarations
  DATA: lv_class            TYPE sibftypeid,
        lv_event             TYPE sibfevent,
         lv_objkey           TYPE sibfinstid,
  lr_event_parameters TYPE REF TO if_swf_ifs_parameter_container,
  lv_param_name       TYPE swfdname,
  lv_id               TYPE char10.


  lv_class = 'ZCL_WEBDYNPRO_WF'.
  lv_event   = 'TRIGGER'.

* Instantiate an empty event container
  CALL METHOD cl_swf_evt_event=>get_event_container
    EXPORTING
      im_objcateg  = cl_swf_evt_event=>mc_objcateg_cl
      im_objtype   = lv_class
      im_event     = lv_event
    RECEIVING
      re_reference = lr_event_parameters.

* Set up the name/value pair to be added to the container
  lv_param_name  = 'I_KUNNR'.  " parameter name of the event
  lv_id          =  i_kunnr.


  TRY.
      CALL METHOD lr_event_parameters->set
        EXPORTING
          name  = lv_param_name
          value = lv_id.

    CATCH cx_swf_cnt_cont_access_denied .
    CATCH cx_swf_cnt_elem_access_denied .
    CATCH cx_swf_cnt_elem_not_found .
    CATCH cx_swf_cnt_elem_type_conflict .
    CATCH cx_swf_cnt_unit_type_conflict .
    CATCH cx_swf_cnt_elem_def_invalid .
    CATCH cx_swf_cnt_container .
  ENDTRY.

* Raise the event passing the event container
  TRY.
      CALL METHOD cl_swf_evt_event=>raise
        EXPORTING
          im_objcateg        = cl_swf_evt_event=>mc_objcateg_cl
          im_objtype         = lv_class
          im_event           = lv_event
          im_objkey          = lv_objkey
          im_event_container = lr_event_parameters.
    CATCH cx_swf_evt_invalid_objtype .
    CATCH cx_swf_evt_invalid_event .
  ENDTRY.

  COMMIT WORK.

endmethod.  

Go to SWDD transaction and create a new workflow called ZTEST_WF  

Go to header and Start events tab and enter the below details  

 

Now if we call the SET_CUSTOMER method it will trigger the ZTEST_WF workflow.

分享到:
评论

相关推荐

    Workflow-based Process Controlling

    工作流过程控制,讲述基于工作流的过程控制原理

    PDF to JPG.workflow

    总结来说,"PDF to JPG.workflow"是一款实用的工具,对于需要频繁进行PDF转JPG操作的用户来说,它提供了便捷高效的解决方案。不过,用户在使用时也应注意根据实际需求调整参数,以获得最佳的转换结果。同时,对于有...

    Beginning WF: Windows Workflow in .NET 4.0

    Windows Workflow Foundation is a ground-breaking addition to the core of the .NET Framework that allows you to orchestrate human and system interactions as a series of workflows that can be easily ...

    Creating an SAP Workflow with Workflow Builder

    Discover how to create a simple workflow, and then build upon it to show enhanced features. Understand data flow, find out about the types of steps you can use to create a workflow, and send a ...

    论文研究-The Design of PQRM-based Pegasus Workflow System.pdf

    刘奇和张琳的研究聚焦于设计一个基于PQRM(Policy-based Quality Resource Management)资源管理平台的Pegasus工作流系统。 工作流管理系统(Workflow Management System, WfMS)是用于自动化执行工作流中各项任务...

    Laravel开发-workflow

    'Workflow' => \Symfony\Component\Workflow\Workflow::class, ``` 现在我们已经准备好了基础架构,可以开始定义工作流了。在 Laravel 中,可以创建一个新的 PHP 类来表示工作流定义。例如,创建一个 `src/...

    Workflow Based Invoice Controlling for SAP R3

    Workflow based invoice controlling for SAP R/3

    release-based-workflow

    外星人入侵 ... 它根据GPL和MIT许可发布,以实现您的意愿。 可播放的版本: : 移动版Bit.ly链接: : 如果您对游戏进行了有趣的改进或改进,请告诉我,它将链接到此处。 该原始存储库将保持与本书中的代码匹配。...

    Visual C# 2008 How to Program Solution Manual

    《Visual C# 2008 How to Program》是一本专为学习C#编程语言而设计的教材,其Solution Manual提供了书中的习题解答,帮助读者深入理解和掌握C#编程的核心概念和技术。这本书由Deitel兄弟撰写,他们在计算机科学教育...

    Laravel开发-laravel-workflow

    Workflow::register(Article::class, 'article', $workflow); ``` **5. 应用工作流** 现在可以在模型中使用定义好的工作流了。例如,更新文章状态: ```php // 获取文章 $article = Article::find(1); // 提交...

    Research and Design of Document Flow Model Based on JBPM Workflow Engine

    Research and Design of Document Flow Model Based on JBPM Workflow Engine

    Pro WF - Windows Workflow in .NET 4.pdf

    Integrating WCF and WF Who this book is for This book is for intermediate to advanced .NET developers who need to learn how to use the latest version of Windows Workflow Foundation (WF 4). This book ...

    Research on Workflow Patterns Based on jBPM and jPDL

    Research on Workflow Patterns Based on jBPM and jPDL

    TMS Workflow Studio v1.8.1.1 Full Source (D7 to XE4)

    Workflow Studio is a Delphi/... With Workflow Studio you can easily add workflow and BPM capabilities to your application,by allowing you or your end-user to create workflow definitions and running them.

    SharePoint 2010 Workflow

    为SharePoint 2010 Workflow 开发 Custom Workflow Activity(Develop Custom Workflow Activity for SharePoint 2010 Workflow). SharePoint2010提供了很多有用的开箱即用的Activity(活动action),我们可以在...

    simple workflow

    在描述中提到“very easy to understand the idea of workflow”,这表明这个压缩包可能包含了一些基础示例或教程,旨在通过直观的方式解释工作流的基本原理。通常,工作流系统会包括定义工作流程、分配任务、跟踪...

    Hue-workflow配置流程

    Hue的Workflow(工作流)组件则是用于构建和管理复杂的Hadoop作业流程,允许用户通过拖拽操作来设计数据处理任务,而无需编写复杂的命令行脚本或Java代码。在本文中,我们将深入探讨如何使用Hue配置和运行一个...

Global site tag (gtag.js) - Google Analytics