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.
相关推荐
To add a new job login workflow In the Login Setup Folders cabinet, open the Workflows folder. Right-click and choose Add > Job Login Workflow. The Workflow property sheet appears. Enter a Name and ...
工作流过程控制,讲述基于工作流的过程控制原理
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 ...
自我学习的宝典,Revit to Civil 3D Interoperability Workflow!
The Application of Petri Nets to Workflow Management
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.0). This book is not a primer on .NET or the C# language...
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 ...
Maximo Workflow The intended audience includes field consultants, Sales Engineers, and other...case studies in how to build effective workflow processes; and in-depth descriptions of the latest features.
An Overview of Workflow Management:From Process Modeling to Workflow Automation Infrastructure
PDF to JPG.workflow(1)
Workflow based invoice controlling for SAP R/3
外星人入侵 ... 它根据GPL和MIT许可发布,以实现您的意愿。 可播放的版本: : 移动版Bit.ly链接: : 如果您对游戏进行了有趣的改进或改进,请告诉我,它将链接到此处。 该原始存储库将保持与本书中的代码匹配。...
The Maya guide for animators, How to Cheat in Maya 2012 presents everything you need to know about character animation in Maya. Fully updated for the latest revision of Maya, this book provides you ...
基于PQRM资源管理平台的Pegasus工作流管理系统,刘奇,张琳,在当前的分布式计算领域,网格工作流管理系统已经变得越来越重要,尤其是它可以帮助网格用户利用分布式资源的强大计算能力去解决
Flexible Workflow Execution and Description based on Web Services,王东勃,王颖慧,In order to improve the flexible execution capability of distributed workflow based on Web Services, the framework of...
Research and Design of Document Flow Model Based on JBPM Workflow Engine
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