Demo on Workflow using Classes.docx

上传人:b****5 文档编号:8237831 上传时间:2023-01-30 格式:DOCX 页数:14 大小:1.22MB
下载 相关 举报
Demo on Workflow using Classes.docx_第1页
第1页 / 共14页
Demo on Workflow using Classes.docx_第2页
第2页 / 共14页
Demo on Workflow using Classes.docx_第3页
第3页 / 共14页
Demo on Workflow using Classes.docx_第4页
第4页 / 共14页
Demo on Workflow using Classes.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

Demo on Workflow using Classes.docx

《Demo on Workflow using Classes.docx》由会员分享,可在线阅读,更多相关《Demo on Workflow using Classes.docx(14页珍藏版)》请在冰豆网上搜索。

Demo on Workflow using Classes.docx

DemoonWorkflowusingClasses

DemoonWorkflowusingClasses

ByRichaGupta,SpartaConsultingfrom Link

 

Purpose

TodevelopworkflowusingOOPSconceptinsteadofusingstandardBusinessObject. 

NOTE:

Beforefollowingthisdocument,onemusthaveabasicknowledgeofOOPSConcepts.

StepstofollowtouseClassesinWorkflow  

 HowtoCreateCustomClass  

HerewewillbecreatingacustomclassforMATERIAL.

Gototransaction SE24 andcreateacustomizedclass.

Nextthepopupappearswhereweneedtomentionthedetailasfollows:

Saveitandtheclassiscreated.

NowtheclassistoimplementIF_WORKFLOWinterface.Forthisgotothe  

  tabanddeclaretheIF_WORKFLOWastheinterfacethereandpressEnter;twosub-interfacesappear:

 BI_OBJECT and BI_PERSISTENT.SavetheClass.

TheZCL_TESTclassnowcontainstheexistingmethodsofIF_WORKFLOWinterface. 

Also,2newinterfaceswillbeautomaticallyaddedonceyouaddIF_WORKFLOWinterfaceintheclassasshownbelow:

EachmethodoftheIF_WORKFLOWInterfacehasitsdistinctfunctionality,whichisdiscussedbelow.  

 BI_PERSISTENT~FIND_BY_LPORMethod:

  

 Here,tocreateobject,constructorofclassneedstobeimplementedasfollows:

 

Here,SET_ATTRIBUTESmethodiscalledwhichwillbeimplementedasfollows:

 

BI_PERSISTENT~LPORMethod:

BI_PERSISTENT~REFRESHMethod:

  

Ifwedonotneedthemethodinourclass,thenweneedonlytocarryouta“dummy”implementation(withoutfurthercoding)toavoidprogramerrorswhenthesystemcallsthemethod. 

 

 BI_OBJECT~DEFAULT_ATTRIBUTE_VALUEMethod:

  

 BI_OBJECT~EXECUTE_DEFAULT_METHODMethod:

  

 BI_OBJECT~RELEASEMethod:

  

Now,theattributesneedtobedevelopedtoimplementabovemethodsareasfollows:

  

Totriggertheworkflowusingeventofclass,wemustalsocreateaneventoftheclass.Todothis,gotoEVENTStab,andtherecreateaneweventCREATEDasshownbelow:

  

Beforeimplementingabovemethods,alocaltypeneedstobecreated.Todothis,clickonLOCALTYPESasshownbelow:

 

Nowwritethebelowcode:

  

HowtouseClassinaWorkflow  

Here,theworkflowneedstobetriggeredassoonasamaterialiscreated.Andthenaworkitemshouldgotoinitiatortoeditthesamematerial. 

GotoSWDDtocreateanewworkflow.

ClickonBasicDataTab:

 

GiveanabbreviationandShortDescriptiontoworkflowasfollows:

NowclickonSTARTEVENTStabandspecifythefollowingstandardeventofthestandardclass:

NowgobackandrightclickinbetweentheWORKFLOWSTARTEDandWORKFLOWCOMPLETED.

SelectCREATE.Alistofavailablesteptypeswillbedisplayedasfollows:

 

  

SelectACTIVITYfromthislist.Thefollowingscreenwillappear:

 

Specifythefollowingdetailshere:

 

ClickonBindingtab.Bindingwillbeasfollows:

 

Clickontaskdescription.Automaticallyfollowingdetailswillshow:

 

Clickonthegreenbuttonforbindingaboveandconfirmthebindingsmustbeasfollows:

SETAGENTASSIGNMENT:

  

ClickonyellowbuttoncomingbesidesAgentAssignment:

 

ClickonATTRIBUTES:

  

  

SelectGeneralTaskandclickonTRANSFER 

  

HowtotriggereventofClass  

Totriggereventofaclass,weneedtocallmethodRAISEofstandardclassCL_SWF_EVT_EVENT.Thismethodcanbecalledinauserexit,BAdi,oracustomreportdependingontherequirement. 

Inourcase,wearecallingthemethodinaBAdi‘BADI_MATERIAL_CHECK’. 

ThemethodinwhicheventwillberaisedisCHECK_DATA. 

CreateanewcustommethodRAISE_EVENTintheclassimplementedforBAdi.

Followingmethodwillbecalledtoraiseevent:

 

Activateclassandgoback.

NowgoinCHECK_DATEmethodandwritethebelowcode:

 

Output 

Createanewmaterial.Todothis,gotoMM01. 

  

PressEnterandthefollowingscreenwillappear:

 

  

SpecifytheabovedetailsandpressEnter.Onthenextscreen,enterthefollowingdetails:

 

ClickonSAVE 

button. 

  

Assoonasthematerialgetscreated,theworkflowwilltriggerasshownbelowintheworkflowlog:

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 合同协议

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1