반응형
Introduction

In the first exercise, you built a basic process with roles, activities, and transitions. In this lesson, you will further enhance the process by creating data types, variables, Task Services, Rule Services, and Adapter Services and binding them to the process activities.

Objectives

After completing this lesson, you will know how to:
   • Implement Process Activities and create Task, Rule and Adapter Services
   • Define the different kinds of Data Objects (variables)
   • Define Data Inputs and Data Outputs (arguments)
   • Map arguments to instance variables

The tasks you will complete in this lesson are:
   • Understanding of Business Catalog
   • Define Task Services and map to Interactive Tasks
   • Define Rule Services and map to Rule Task
   • Define Adapter Services and map to Service Task.
   • Create Business Objects (data types)
   • Create Data Inputs (input arguments) and Data Outputs (output arguments) for process and process steps
   • Create Variables (Data Objects)
   • Create Data Mappings



Create a Business Object



QuoteProcessLab - Business Catelog 에서 마우스 오른쪽 버튼 클릭 - "New - BusinessObject" 클릭.



Business Object: Quote

Destination Module 오른쪽의 돋보기 아이콘을 클릭합니다.



Module 버튼 클릭.



Module: Data



"Data" 선택.



Based on External Schema 선택 후 오른쪽의 돋보기 클릭.



Import 버튼 클릭 후 URL 오른쪽의 돋보기 버튼 클릭.



Quote.xsd 파일 선택.



"Copy to Project" 체크.



"Maintain original directory structure for imported files" 체크 해제.



QuoteRequest 선택.



OK 버튼 클릭.




Data Inputs and Data Outputs

Data Input refers to the information required to start the Activity (Task, Sub-process) or Process. It is the input argument. A collection of Data Inputs is referred to as an Input Set.

Data Output refers to the data that is returned from the Activity or Process. It is the output argument. A collection of Data Outputs is referred to as an Output Set.

The Start Event has only Output Set. The End Event has only Input Set. Other activities can have both Input and Output Sets.

The Output Set of the Start Event and the Input Set of the End Event determine the arguments of the Process.



Note: As you will see in later section, the input and output arguments of the process step is the same as the inputs and outputs of the Service (Task, Rules, or System) that it is bound to.



Creating Data Objects

아래와 같이 5개의 Process Data Object를 만들어야 합니다.



BPM 프로세스가 열려 있는 상태에서 왼쪽 하단의 구조(Structure) 창에서 작업합니다.

"Process Data Objecs" 에서 마우스 오른쪽 버튼 클릭 - New 클릭.



Name: approveDealOutcome
Type: String



Name: approveTermsOutcome
Type: String



Name: businessPracticesOutcome
Type: String



Name: businessPracticesReviewRequire (d는 짤림 -_-)
Type: Bool



기본형(?)이 아닌 타입의 선택 방법은 아래와 같습니다.

Name: quote
Type: <Component>

오른쪽의 돋보기 클릭.



Quote 선택



OK 클릭.




Implementing Enter Quote Details


Defining the Task Service

"Enter Quote Details" 액티브티를 더블 클릭하여 편집합니다.



Implementation 탭으로 이동합니다.

Human Task 오른쪽의 Add 버튼을 클릭합니다.



Name: EnterQuoteDetails
Pattern: Initiator
Title: Enter Quote

Parameters: 오른쪽의 추가 버튼을 클릭합니다. 오른쪽에 "Browse Data Objects" 창이 열립니다.

RequestQuoteLab - quote 를 파라미터 영역에 드래그 합니다.



아래와 같이 추가가 되면 Enable 을 체크 합니다. OK 버튼 클릭.



OK 버튼 클릭.



QuoteProcessLab -  Business Catalog - HumanTasks 에 보면 방금 만든 휴먼 테스크가 하나 추가되어 있습니다.

"EnterQuoteDetails.task" 더블 클릭.



Task Title: Text and XPath

오른쪽의 Expression Builder 버튼 클릭.



아래와 같이 입력. (Expression Builder 이용)

concat('Enter Quote Details for customer', /task:task/task:payload/ns0:QuoteRequest/ns0:Summary/ns0:AccountName, 'Quote id = ', /task:task/task:payload/ns0:QuoteRequest/ns0:Summary/ns0:OpportunityID)



Generate Form for the Task

Create Form 클릭 - Auto-Generate Task For... 클릭.



Project Name: EnterQuoteUILab



아래와 같이 ADF 프로젝트가 생김. 전부 저장 후 닫기.



Bussiness Practices Review, Approve Deal, Approve Terms, Finalize Contract 4개의 액티브티도 동일한 방식으로 Human Task를 생성합니다.

"Business Practices Review" Human Task 생성.








BusinessPracticesReview.task 파일 편집(더블 클릭)







Approve Deal 구현






Approve Terms 구현





Finalize Contracts 구현



Outcomes 변경.



"Finalize Contracts"의 outcome은 OK 만 설정합니다.







Mapping swim lane Roles to LDAP Roles

"Organization"에서 오른쪽 버튼 클릭 - Open 클릭



Roles 탭에서 작업합니다.

SalesRep 롤 선택 후 맴버를 등록합니다. (웹로직에 등록되어있는 유저를 찾기)



jcooper 유저를 선택합니다.



Approvers 롤은 cdickens 유저.



Business Practices 롤은 jstein 유저.



Contracts 롤은 wfaulk 유저.



Process Owner 롤은 jstein 유저.




Configuration of the Service Task

Now complete the following to add a service to your application which implements the SaveQuote Service Task. First you create the service by adding a Service Reference to the application using the composite editor. Then, you go back to the BPM process and bind the service to the SaveQuote Service Task.

BPM 편집기 상단 오른쪽의 "Goto Composite Editor" 버튼을 클릭합니다.



"File Adapter"를 추가합니다.



Service Name: SaveQuote





Write File 선택.



Directory for Outgoing Files: /tmp/quotes (원하는 곳으로 설정)

File Naming Convention: quote_%SEQ%.txt



메세지 구조를 설정합니다.

URL 오른쪽의 돋보기 버튼 클릭.



Quote.xsd - QuoteRequest 선택.



Next 버튼 클릭.



Finish 클릭.



아래와 같이 File Adapter 컴포넌트가 생성 되었습니다.



다시 BPM 편집기로 넘어와 "Save Quote" 액티브티를 편집합니다.



Implementation: Service Call

Name 오른쪽의 돋보기 버튼 클릭.



"SaveQuote" 선택.



Use Associations 선택 후 편집(연필) 버튼을 클릭합니다.



아래와 같이 오른쪽의 "quote"를 왼쪽의 Input 으로 드래그합니다.



OK 버튼 클릭.



Business Catelog - Services 부분에 SaveQuote 가 추가되어 있는 것을 볼 수 있습니다.





Data Association configuration for conditional flows

The outcomes of the Business Practices Review, Approve Deal and Approve Terms Interactive tasks have to be evaluated for conditional branching. The task outcome of these tasks is a string value of “APPROVE” or “REJECT”. You set these outcomes when you defined the task. The outcomes get mapped to the Data Objects so you can then use the Data Objects in the conditional expressions used for branching.

"Business Practices Review" 액티브티를 열어 편집합니다.

Implementation 탭에서 "Use Associations" 체크 후 편집합니다.



아래와 같이 "businessPracticesOutcome" 데이터를 outcome 출력 인자에 추가에 매핑합니다.



Approve Deal 액티브티는 approveDealOutcome 데이터를 outcome 출력 인자와 매핑합니다.



Approve Terms 액티브티는 approveTermsOutcome 인자.



Business Practices Rejected(Sequence Flow)를 편집합니다.



Properties 탭에서 businessPracticesOutcome == "REJECT" 입력.




Deal or Terms Rejected(Sequence Flow)를 편집합니다.



approveDealOutcome == "REJECT" or approveTermsOutcome == "REJECT"



Business Practices Revie(User)로 가는 Yes(Sequence Flow)를 편집합니다.



businessPracticesReviewRequire == true





Configuration of Script Tasks

Finally, you need to add a Script Task to set the payload (the input data) for the Enter Quote Details task and to determine whether the Business Practices Review activity is required or not. The script goes right before Enter Quote Details. Using a script to set the input data makes testing this process easier but when running such a process for real, the user who initiates the task would enter the input data.

Script(Activity)를 Start와 Enter Quote Details(Activity) 사이에 추가합니다.



Name: Initialize Quote



Implementation 탭에서 User Associations 채크하고 편집합니다.



아래와 같이 quote 데이터를 중앙에 드래그 합니다.



Expression Builder 버튼 클릭.



Mode: XML Literal

<ns1:QuoteRequest xmlns:ns1="http://www.mycompany.com/ns/salesquote">
  <ns1:Summary>
    <ns1:OpportunityID>zzzz2</ns1:OpportunityID>
    <ns1:AccountName>Acme New</ns1:AccountName>
    <ns1:Address>
      <ns1:Street>Demo Way</ns1:Street>
      <ns1:City>Redwood Shores</ns1:City>
      <ns1:State>CA</ns1:State>
      <ns1:Zip>94065</ns1:Zip>
      <ns1:Country>USA</ns1:Country>
    </ns1:Address>
    <ns1:SalesRepId>jcooper</ns1:SalesRepId>
    <ns1:SalesRepName>James Cooper</ns1:SalesRepName>
    <ns1:ValidUntil>2010-05-30</ns1:ValidUntil>
    <ns1:EffectiveDiscount>0.0</ns1:EffectiveDiscount>
  </ns1:Summary>
  <ns1:QuoteRequestStatus/>
</ns1:QuoteRequest>



businessPracticesReviewRequire 데이터를 추가합니다.



Expression Builder 클릭.



Mode: XPath Exp.

Expression: false()



OK 버튼 클릭.



Enter Quote Details(Activity)의 Data Associations 편집 화면에서 uuote 데이터를 quoteRequest 입력 인자에 추가합니다.




Deploying the process

배치 합니다.





관련된 Human Task 프로젝트도 같이 배치합니다.












반응형
//