Guest987
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 📍 BPMN Progress & Homework ###### tags: `Camunda` `bpmn` ## 🦫 Go client :::info :bulb: 使用 Go 和 Camunda Platform 8 進行互動 ::: ### tasklist.go 各個 func 的說明 #### 🔸 `NewZeebeClient` 創建並返回一個 Zeebe 客戶端實例,與 Zeebe 服務進行連結。 #### 🔸 `DeployBPMNFile` 部署指定的 BPMN 檔案 `NewDeployResourceCommand` 是一個部署資源的命令,將指定的檔案填入,使用 `AddResourceFile` 方法。 `fileName` 是要部署的 BPMN 檔案的路徑。 然後,使用 `Send` 發送命令到 Zeebe 服務,並得到部署的回應和可能的錯誤。如果有錯誤,使用 `log.Fatalf` 輸出錯誤訊息並終止程式執行。 最後,回傳值會是一個 `*pb.DeployResourceResponse` 的結構體,它返回部署的回應物件 `response`,其中包含了部署的相關資訊,例如部署鍵`deployment key` 等。想了解更多的話,可以點進去看與這個結構體相關的func。 #### 🔸 `CreateProcessInstance` 創建一個流程實例 `CreateInstanceCommand`,用於創建流程實例。 使用 `BPMNProcessId` 方法設置要使用的 BPMN 流程的 `processId`。 然後,`LatestVersion` 指定使用最新版本的流程。 接著檢查傳入的 `variables` 參數中的變數是否存在。如果存在,則使用 `VariablesFromMap` 將變數從 **variables 映射** 轉換為所需的格式。如果轉換過程中發生錯誤,會返回錯誤。 #### 🔸 `CancelProcessInstance` 取消指定的流程實例 `CancelInstanceCommand`,用於取消流程實例。使用 `ProcessInstanceKey` 設置要取消的流程實例的鍵值 processInstanceKey。 #### 🔸 `GetAllUserTask` 獲取所有待完成的 userTask 的詳細資訊 `ActivateJobsCommand`,用於激活特定類型的工作。 `JobType` 方法設置工作類型為 `io.camunda.zeebe:userTask`。 `MaxJobsToActivate` 設置最大要激活的工作數量為 100。 `Timeout` 方法設置超時時間為 1 分鐘。 `WorkerName` 方法設置工作者名稱為 `my-worker` #### 🔸 `GetJobInfoByProcessInstanceKey` 根據指定的流程實例 key,獲取待完成的 userTask 的詳細資訊 與前面提到的 `GetAllUserTask` 函式相似,只是在建立 `ActivateJobsCommand` 的時候多了一個條件:`ProcessInstanceKey` #### 🔸 `GetJobInfoByProcessDefinitionKey` 根據指定的流程定義 key,獲取待完成的 userTask 的詳細資訊。 與前面提到的 `GetAllUserTask` 函式相似,只是在建立 `ActivateJobsCommand` 的時候多了一個條件:`ProcessDefinitionKey` #### 🔸 `GetJobInfoByProcessId` 根據指定的流程 ID,獲取待完成的 userTask 的詳細資訊。 與前面提到的 `GetAllUserTask` 函式相似,只是在建立 `ActivateJobsCommand` 的時候多了一個條件:`ProcessId` #### 🔸 `CompleteJob` 完成指定的工作 `NewCompleteJobCommand` 創建一個新的完成工作命令。 `jobKey` 用於指定要完成的工作。 接下來使用 `VariablesFromMap` 將變數映射轉換為 Zeebe 的變數格式。 #### ID 區別 | ID | 中文 | 解釋 | | ------------------- | ---------- | ------------------ | | processDefinitionId | 流程定義ID | 整個流程的定義 | | processInstanceId | 流程實例ID | 流程中其中一個實例 | | id | 任務ID | 實例中的任務 | * `id` 不會重複 * 一個Process Instance(流程實例)是一個ProcessDefinition(流程定義)的執行 * 一個Process Instance(流程實例)可以有許多同時執行的步驟(concurrent executions) ## ⬅️ Review ### 📝 Quiz #### 🔸 4/27 - 請採購流程 :::warning 確保所有 ID 都有可讀性,表單部分自行設計 ::: ##### 請購單 建立一張請購單,填寫完成後的審核順序為:單位主管 ➡️ 總經理<p> * 審核不通過,需要重建請購單,重建超過 3 次將結束流程 * 總經理審核完畢,進入採購程序 > :speech_balloon: Tips: > - 使用 Outputs 技巧,自動控制變數 > - 使用 call subprocesses,呼叫其他流程 </p> --- ##### 採購單 建立一張採購單,填寫完成後的審核順序為:單位主管 ➡️ 處長 ➡️ 總經理 <p> * 審核不通過,需要重建採購單 * 總經理審核完畢,進行採購單入庫動作 > :speech_balloon: Tips: > - 使用 call subprocesses,呼叫其他流程 </p> --- ##### 採購單入庫 確認採購數量,數量正確,直接入庫並結束流程;如數量不足,只將部分採購品入庫,後續要進行補足,並確認數量是否正確。 --- **以上都完成後,請在 5/5 之前將 bpmn 檔案、流程demo影片 mail 給我~~** <p> 主旨:姓名 _ bpmn 小考 > [name=C109118215@nkust.edu.tw] ### 🔸 3/22 - Subprocesses & Multi-instance :::success 子流程可以是獨立的也可以嵌入到主流程中。子流程還可以是 sequential, parallel, event, 或 call subprocesses ::: #### 嵌入式的子流程範例 ![](https://i.imgur.com/QidahmF.png) * 子流程具有自己的**開始事件、結束事件**。 * 當主流程執行到子流程時,它會進入子流程並在執行子流程中的所有步驟,然後再返回到主流程中繼續執行主流程中的其他步驟。 #### Multi-instance - Sequential vs. parallel 在BPMN中,使用一個多重實例(Multi-Instance)工作項目來表示**迭代行為**。可以用來做需要多次執行的任務。 > :speech_balloon: 例如:產品需要進行多次品管檢驗,每次檢驗都需要獨立進行。 * Sequential - 序列 <p>使用序列的情況下,一次只會執行一個任務。</p> ![Sequential](https://i.imgur.com/AEyCIYq.png) * Parallel - 並列 <p> 相對地,使用並列的話,任務可以同時進行,彼此獨立,而且不用等待上一個步驟完成。 </p> ![Parallel](https://i.imgur.com/hthz90d.png) ### 🔸 3/15 - Getting started with human task orchestration :::success Users can enter the necessary data to drive the business process. ::: #### Develop a automated process ![Decide what's for dinner](https://i.imgur.com/3DcQIep.png) * set sequences flows `= meal = "Salad"` `= meal = "Chicken"`. #### Add a form ![](https://i.imgur.com/Hx3eEl8.png) * Then switch to `JSON` mode and paste all to `Decide what's for dinner`. ## 📚 Homework :::info :bulb: Better late than never. ::: ### 🔸 3/22 - 檢討與練習 #### :pencil2: 將 3/15 的作業與今日的上課內容做檢討 使用 HackMD 或 簡報等文件方式,呈現出自己的流程圖與標準答案之差異,簡單說明為什麼會想這麼畫,並將自己的流程圖進行除錯。 #### :pencil2: 嘗試繪製以下流程: 員工可以選擇請假或是執行指派任務: <p> 請假可以選擇病假、事假、公假,病假和事假要先由直屬主管批審過才能交給最高主管批審,公假直接由最高主管批審即可。 </p> <p> 執行指派任務要回報給任務經理,批審通過後結束。 </p> > :speech_balloon: 提示: > - 請假、執行指派任務擇一繪製子流程,看是要嵌入子流程或是 all activity 的方式都行 > - 作業:流程圖、簡報或文件最晚星期一之前 mail 給我 > [name=C109118215@nkust.edu.tw] > - 善用 [文件](https://docs.camunda.io/docs/components/modeler/bpmn/gateways/) 查詢基礎BPMN概念 > - 一樣有問題在群組問 ### 🔸 3/15 - 將需求視覺化呈現 #### :pencil2: 嘗試繪製以下流程: 當業務填寫一張請款單,填寫完畢繳交至主管審核,主管可以選擇退回或通過,通過後再交由總經理進行最後審核。 > :speech_balloon: 提示: > - 此流程只需要一個 `Pool` > - 練習新增多層 `Lanes` > - 練習製作表單 ( 要能夠選擇退回或通過,不一定要用select box,可以自行發揮 ) > - 有問題的話可以在群組問,建議先自己Google > - 將學到ㄉ東西與成果的重點簡化後做成簡報,必要時請善用示意圖講解。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully