Skip to main content

JBoss BRMS - 在 Guvnor 界面拖拉一個人工任務(快速版),(偽)長假申請流程。

這是應觀眾要求寫的,如果漏寫的啥請原諒我,因為我晚上一點才開始寫,已經很累,有點要爆肝的感覺,就先收下吧。

在開始之前,請先確定你的BRMS Server 是安裝OK的。然後使用者資訊也在Server 上都設定成功登入正常。 在Task Server 上也把你的使用者資訊都放置上去了。
(不熟的請去看Admin guide, 不然就等我哪天閒到不行再寫吧。)

登入 http://IP:PORT/jboss-brms之下,我們先建立一個新的Package來放這個Process.

 輸入package name:


這時左手邊就會出現你剛剛建立的package,


 可以開始建立第一個流程拉,到Create New下 ,選擇New BPMN Process


給他一個流程的名字,記得Package 要選剛剛建的那個喔~


稍微等一下,因為瀏覽器要畫出editor,然後在左邊選單選擇Start Events下的Start Event, 然後直接拖拉到右手邊空白的畫布上。.


你就會看到下圖的圓圓開始,選擇它,這時右邊應該會出現一堆可以按的快速建立鈕,請直接按選方形的那個。
 以此類推,在新建的Task 上點選,出現快速建立鈕時再選一次方形的那個。
 接下來我們的流程就要結束了,所以請選擇實心的圓形。
 建立好之後,請按選第一個正方形的Task, 然後把右邊的Proprties 設定頁拉大一點。
 在TaskType 選擇 Script,給他一個Name : Logging

既然是個Logging 的 Script Task, 那就來寫個log 吧,點選下方Extra 的 Script,之後會跳出一個畫面,請在裡面寫上,

System.out.println("Starting A Process");
好,上一個Logging 的Task 已經完成了,請把滑鼠游標點在空白畫上,這時右手邊Properties 會變得比較不一樣,因為已經變成Process Level 的屬性了,請點選Variable Definitions, 我們要來設定這個流程收什麼資料。

因為本小姐很想放個長假,所以,我就定義這個流程叫做長假申請好了,使用者輸入名字想請的假期長度...


以上流程的屬性也設定好了,接下來,就是設定人工流程,請選擇第二的Task, 然後選擇User。


每個人工流程都要定義自己的Data Input, 有點像是method 的parameter,請選擇DataInput。
對了,快速起見,我先定一這個Task 會丟給自己 (Actors 設定為christina)


設定如下。

然後,要把流程的變數,聯結到剛剛我們做的data input裡,所以請按Assignement. 


設定如下。
 

最後,也是最重要的一步,給個名字吧。總共有兩個地方,如下圖。


流程的部分到這裡就完成了。接下來因為我想用BRMS 內建的jbpm console 秀畫面,所以,我就點選右上方那個人形小圖,它會自動幫我產生畫面。(快爆肝了)

                          

會跳出這個畫面,產生兩個FORM,一個是流程一開始的時候,輸入的畫面,與人工任務的畫面。不想進去看就close。
 大致完成了,請按上方Validate 的小按鈕,確認流程無誤。




這時應該會出現一個X,因為我們還沒有幫這個流程產生圖檔。請按最下方的PNG. 然後再Validate一次,就沒問題了。



 記得Save.

回到com.redhat.demo 的Package 之下,你會看到新增的流程,

 


選擇上方Tab鍵的Edit,點選Validate Config,還有Build Package。



以上,建制的部分就完成了。

接下來,就是去jbpm console 驗收了。請到
http://IP:PORT/business-central/ 下,用christina (或是你自己的ID)登入

 到左手邊選擇Processes, 這時,就會看到剛剛建立的DemoProcess.

 請選取它,然後按Start.

 第一個FORM就出現請你輸入名字跟要請假的天數

輸入後就會成功的訊息。

選取剛剛開始的流程後,點選右下方的Diagram,可以看到現在流程跑到哪裡囉~

再去左手邊的Task->Personal Tasks裡面,就可以看到剛剛的Process 已經被分配過來了。(看不到的請按refresh)

畫面上應該會出現你輸入的兩個值。


就是這樣拉~


以上。我要睡覺去。

Comments

Popular posts from this blog

Fuse Integration Service - Setup JBDS and create first quickstart application

Before we go and start creating our first application, I want to show you how to setup your JBoss Developer Studio, create a small application from the quickstart example and then running it on Fuse Integration Service.

I am using JBoss Developer Studio version 9, you can find it here.
After download the

jboss-devstudio-9.0.0.GA-installer-eap.jar
double-click it, and start installing with default values.

After successful installation, we will need install the plugins for Fuse, on JBoss Central view, select software update, select enable early access.


And select JBoss Fuse Development for the plugin,


Click on install, and we are all set to go!

First thing first, we want to create a Fuse project to deploy on the base of Fuse Integration Service, which is OpenShift. If you have not installed it, please go back to my previous post for instructions. So on your JBDS, right click and start creating the project. Select new, maven project, if you have installed the plugin correctly, you should …

RHTE - Supercharge your integration services

Red Hat Tech Exchange has taken place in Vietnam, Ho Chi Minh city two weeks ago, it is a great event held by Red Hat in Asia Pacific Region. It is open to all Red Hat partners who are interested in learning what Red Hat is doing recently, see what the trend of the open source world, basically it is a great event to share your knowledge and experience, to meet other enthusiastic people.

I am very fortunate to talk in this great event, to talk about the things I have been working on and even discuss it with many. Also got lots of great ideas too. So here are the slide.

My first talk was with Thomas Qvarnström about how to handle large size data in JBoss Fuse and how JBoss Data Grid can help in the situation.

Here is the agenda of the talk, we will be talk about this in the up coming webinar on 24th Sept.

Integration often involves storing, retrieving, and transforming data. Using a traditional database in your integration is likely to becomes a bottleneck that is expensive and hard to …

Red Hat JBoss Fuse/A-MQ - Fuse and A-MQ Version 6.3 GA is released!

Fuse and A-MQ 6.3 GA has just went out. Maybe, you would think this is just only a minor version release why should I care? Hold your thoughts on that! Because they have done a lot of improvements and also added many new features into this release.

Besides various bug fixes and making sure Fuse Fabric is much more stable. There are two major change in this version update:

New Tooling in JBoss Developer Studio (JBDS) 9.1 GA. Newer Apache Camel version – Camel v2.17. I was really impressed by the work put in to make developing Camel application much simpler. First is the installation of tooling itself. Now it has a all-in-one installer so you don't need to worry about which plugins you need to check. See the videos below to see the new "Getting Started" of Fuse 6.3.



And If you notice from the above video, the presentation of camel route in JBDS has also updated. It fixed some of the miss representation of logic and making it easier to read.

Old Camel Route
New Camel Route
On …