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

转 To instantiate any Business object in a Workflow

 
阅读更多

To instantiate any Business object in a Workflow

By Swetabh Shukla, Infosys from Link

 

1. Go to SWDD and create a new workflow. This workflow will have two steps. This is just for test purpose so we are not going to define any triggering event etc.  First step will instantiate (creating a runtime object) a business object and second step will use that runtime object to execute one of its method. We know that to instantiate any BO we need the object key to be passed. Key uniquely identifies a runtime instance of Business Object (henceforth we will refer it as BO or business object interchangeably). 
Note: BO = ‘Business Object’ in all the references below. 

For example use BO BUS1001006. This BO is for Standard Material. Let us consider a material number ‘ZSHUKSWE20’ in this case. The method DISPLAY of BO can be used to display the material passed in key field of the BO BUS1001006. We will try to instantiate the BO for object key = ZSHUKSWE20 which is material number in current scenario. 

We will use Business Object SYSTEM and method GENERICINSTANTIATE to instantiate any Business Object in workflow.


The workflow template will look like this.
 

2. Define a container element of Business Object type which you want to instantiate in a workflow.

We will define a container element of type business object BUS1001006.

 

3. Now Create an Activity type step and use Business Object SYSTEM and method GENERICINSTANTIATE.  This task will be background task since we don’t want any interaction with users.

 
Create the task from workflow builder directly.

 

In binding of the task with method pass variables objectkey and objecttype. These will be created automatically in Task container. The method will return runtime object in export parameter ‘OBJECTINSTANCE’.


Save the task and go back to workflow builder.

 

Now create binding between TASK and workflow. Now here you can pass hard coded values for OBJECTKEY = Material Number and OBJECTTYPE = BUS1001006
 

Save it and finally we have added a step which instantiates a business object. Let’s use this instance to display the material ZSHUKSWE20. This step will return runtime object of type ‘BUS1001006’ and key = ZSHUKSWE20.

4. Create a new activity type step and create a new task for this.

This task will just call method ‘DISPLAY’ of BO instantiated. The method takes some parameters as input but for our current scenario even if we don’t pass import parameter (non-mandatory) it will not be a problem. We are just checking runtime existence of Business Object. So we don’t have to worry about the binding between method and task. But in real scenario do create proper bindings to avoid any error. 

Also do not forget to make the task General task so that any one can execute. Also assign ‘Workflow Initiator’ as agent so that you can test in workflow builder. In real scenarios take care of agent assignment.



Now after we have created the task. Go back and then create binding between task and workflow. We just need to pass our Container element “MATERIAL’ to the task so that the task executes the method DISPLAY with the key ‘ZSHUKSWE20’ and displays the material.

Save the step and activate the workflow.

If we execute the workflow we can check the BO getting instantiated and material getting displayed. 

Directly execute the workflow and check. Go to Business workplace and check. You can see the work item

 

Execute the work item and then check


So we can see the material ZSHUKSWE20 getting displayed which proves that the BO BUS1001006 was instantiated in workflow.  

This way we have seen how to instantiate a Business Object in our workflows. The same we can replicate elsewhere and can utilize already existing Business Objects in our workflows.

分享到:
评论

相关推荐

    Object-Oriented Analysis and Design 第六章

    This allows you to define the type of objects to create while letting subclasses decide which class to instantiate. It lets you decouple the creation of objects from their usage by providing a ...

    JAF 1.0.2 下载

    Sun provides a royalty-free reference implementation of the JAF software, in binary form, that developers can use to develop JAF technology-enabled applications for any platform that supports the ...

    fabric网络踩坑记录

    我的版本 unbuntu 64位(2) fabship2 runApp.sh buildchannel.sh ... cause:instantiate proposal resulted in an error :: Error: 2 UNKNOWN: chaincode error (status: 500, message: is not a valid endorseme

    Unity3D入门 :Prefabs(预设)与 Instantiate(实例化)

    在Unity3D游戏开发中,Prefabs(预设)和Instantiate(实例化)是两个非常重要的概念,它们是构建游戏对象和动态管理游戏世界的基石。本文将深入探讨这两个概念,帮助初学者理解并掌握它们在实际项目中的应用。 ...

    Android代码-WsManager

    WsManager A library that simplifies the use of OkHttp Websocket. ...Instantiate a WsManager object: OkHttpClient okHttpClient = new OkHttpClient().newBuilder() .pingInterval(15, TimeUnit.SECONDS)

    Unity3D教程:Prefabs与Instantiate1

    Unity3D Prefabs 与 Instantiate 教程 Unity 3D 中的 Prefabs 是一种资源类型,可以被重复使用的游戏对象。它可以被置入多个场景中,又或者能够在一个场景中被多次置入。当你在一个场景中增加一个 Prefabs,你就...

    Unity.5.From.Zero.to.Proficiency.B01EJCE85M

    Unity 5 From Zero to Proficiency (Intermediate): A step-by-step guide to coding your first game in C# with Unity. Why this book can help you to get started with Game Development Creating your own ...

    Unity Character Animation With Mecanim pdf

    in a variety of 3D software packages Learn Project Management in Unity Understand how to set up a complex facial rig for speech Set up Animation Controllers with masked states and blend trees to ...

    Build Report Tool 3.0.19.rar

    Basically what it means is if you created your code in such a way that you need to instantiate a prefab at runtime (regardless of whether an instance of it is in the scene already or not) then Unity ...

    exoplayer播放dash+drm widvine加密流

    ExoPlayer是一个开源的Android媒体播放器框架,由Google开发并维护。它提供了一种灵活且高效的机制来处理各种媒体格式,包括视频、音频和文本。... DASH是一种适应性流媒体协议,允许视频内容根据网络条件动态调整其...

    SSH登录无实例化例子

    stdin, stdout, stderr = ssh.exec_command('command_to_execute') output = stdout.read().decode() error = stderr.read().decode() ssh.close() ``` 在这个例子中,我们创建了一个`SSHClient`实例,但只...

    2D Rope System.unitypackage

    Option to connect end objects to point A and B or one of them Option to hide end objects, useful when connecting to A, B points Option to use linerenderer Set linerenderer's material and width Runtime...

    LINQPad_Premium_5.36.03_Any_CPU 含破解

    In the SQL connection dialog, when you choose the 'Display all databases in TreeView' option, a checkbox now appears to lets you choose whether or not to automatically populate the database list on ...

    SimpleMapServer releaserelease 0.713

    b) it is also possible to instantiate the 'MapProducer' class directly inside a java application, then to process an openGis request by passing the request string inside a 'ClientRequest'. After the ...

    解决SpringDataJPA报错:org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null w

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...

    java实验6(Person.java)

    Instantiate the other Person object with the default constructor (that does not accept any parameters), then set it's attributes via the appropriate setter methods. For each of the Person objects, ...

    TPerlRegEx〖D7~XE5〗

    If you want to migrate from an older version of TPerlRegEx to the latest TPerlRegEx, start with removing any TPerlRegEx components you may have placed on forms or data modules and instantiate the ...

    Android代码-AndroidFaceCropper

    To crop faces automatically, you have to instantiate an object of FaceCropper class in that way: FaceCropper mFaceCropper = new FaceCropper(); mFaceCropper.getCroppedImage(source); getCroppedImage ...

    BroadcasReceivert的两种注册模式

    在Android系统中,BroadcastReceiver(广播接收者)是一种重要的组件,用于监听系统或应用程序发出的各种广播事件,并在接收到广播时执行相应的操作。... ...这种模式适合那些只在特定组件运行时需要接收广播的情况,能够...

Global site tag (gtag.js) - Google Analytics