Promotional Items Stock Management Process 20221124
This workflow manages the number of promotional items taken out and the number of items in stock. The number of items in stock can be checked at the time of application for removal. The number of promotional items in stock is automatically updated when the removal of items is completed.
Workers (Number of swimlanes: 3)
  • Applicant
  • Promotional Materials Manager
  • Promotional Materials Manager
Workflow (Workflow diagram complexity: 22)
  • 121. Inventory Number Correction
    • The Promotional Materials Manager corrects the number of promotional materials in stock.
  • 11. Application for materials
    • Applicants are required to specify the number of promotional items to be taken out.
  • 31x. [re]Application for materials
    • The applicant will reapply, specifying the number of promotional items and items to be taken out.
  • 22. Confirmation of removal
    • The Promotional Materials Supervisor will confirm and record that the removal of the items has been completed.
  • 5x1. Set subject
    • The workflow platform stores the subject line.
  • 22x1. Inventory count master file backup
    • The workflow platform backs up the inventory master file.
  • 6x2. Set subject
    • The workflow platform stores the subject line.
  • 10x2. Acquire master inventory count (TSV)
    • The workflow platform retrieves the current inventory count master data.
  • 8x3. Set subject
    • The workflow platform stores the subject line.
  • 17x3. Remove updated source record
    • The workflow platform deletes the record to be updated in the Stock Count Master (TSV).
  • 16x4. Append update record
    • The workflow platform appends the record to be updated to the master inventory count (TSV).
  • 24x5. ID column sort
    • The workflow platform sorts the master inventory count (TSV) using the ID column as the key.
  • 20x6. Generate data for updating
    • The workflow platform extracts the ID and label columns from the master inventory count (TSV).
  • 21x7. Inventory count master update
    • The workflow platform updates the inventory count master file (add-on).
Business process variables to be passed (number of data items: 22)
  • Scheduled date and time of removal q_taking_out 0*
    • The scheduled date and time of the removal will be stored.
  • Applicant q_requester 1
    • The applicant who applies for removal will be stored.
    • ${processInstance.initQuserId}
  • Promotional Material Name q_promotional_items 2*
    • The name of the promotional item to be taken out is stored.
  • Inventory q_stock_count 3*
    • The number of promotional items in stock before they are removed is stored.
  • Number of items taken out q_taking_out_count 5*
    • The quantity of promotional items to be taken out is stored.
  • Reason for removal q_taking_out_reason 4
    • The reason for removal is stored.
  • Number of remaining after removal q_remainding_count 20*
    • The inventory quantity will be stored after removal.
  • Date and time of completion of removal q_taking_out_complete 7
    • The date and time of completion of the withdrawal are stored.
  • ◆ Script: Auto-set inventory count 6
  • ◆ For inventory count master update flow 21
  • Update target: Promotional item name q_target_promotional_items 10*
    • The inventory quantity and the name of the promotional item to be updated are stored.
  • Update target: Inventory count q_target_stock_count 11*
    • The inventory quantity and the inventory quantity to be updated are stored.
  • For Update: Stock Quantity q_update_stock_count 12*
    • The updated inventory quantity is stored.
  • Update trigger: Process ID q_trigger_pid 18
    • The process ID that triggered the inventory count master to update is stored.
    • #{processInstanceId}
  • Before update: Inventory count master (TSV) q_stock_master_tsv 8
    • The master inventory count before the update is stored in TSV format.
  • For update: Inventory count master (TSV) q_update_stock_master_tsv 9
    • The master inventory counts required for updating are stored in TSV format.
  • For update: Inventory count master IDs q_update_stock_master_ids 14
    • The master IDs of the inventory counts required for updating are stored.
  • For update: Inventory count master Labels q_update_stock_master_labels 15
    • The master label group of inventory counts required for updating is stored.
  • For update: Inventory count master q_update_stock_count_option 16
    • The master inventory count required for updating is stored.
  • Inventory count master file (for manual updating) q_stock_master_file_for_manual_update 13
    • The updated inventory count master file is stored. (For manual updating in case of trouble)
  • Before update: Inventory count master file (backup) q_stock_master_backup_file 19
    • The master inventory count file before the update is stored.
  • Comments q_comment 17

Field name, Num, Initial value

Download

This archive contains the BPMN icon, which is only available in the Professional edition.

Notes

  • Associate the processor settings with the organizational structure during import
  • Completing a continuous removal in a short period of time (within approx. 1 minute)
    • Only the last inventory master update out of the continuous processing may be valid.
    • Workaround: Open the [2. Confirmation of take-out] process and the processing completion interval for at least 1 minute. (If you want to achieve this in an automatic process, please consult with us.)

Arrangement Tips

  • Additional types of promotional materials
    • Change the promotional item name master (promotional-item-names.xml) and inventory master (promotional-item-stock.xml) from “App Details > ▼ Apps > Manage Add-ons > Choice Master Used in Selective Data Items”

Capture

Appendix

  • Promotional item name master (optional add-on)
<items>
  <item value="00001" display="Flyer Company Introduction" />
  <item value="00002" display="Product Catalogue  C001" />
  <item value="00003" display="Product Catalogue  C002" />
  <item value="00004" display="Product Catalogue  C003" />
  <item value="00005" display="Product Catalogue  C004" />
  <item value="00006" display="Pamphlet Campaign Summer 2022" />
  <item value="00007" display="Pamphlet Campaign Winter 2022" />
  <item value="00008" display="Pamphlet Campaign Spring 2023" />
  <item value="00009" display="2023 Calendar" />
</items>
  • Promotional item stock master (optional add-on)
<items>
  <item value="00001" display="100" />
  <item value="00002" display="110" />
  <item value="00003" display="120" />
  <item value="00004" display="130" />
  <item value="00005" display="140" />
  <item value="00006" display="150" />
  <item value="00007" display="160" />
  <item value="00008" display="170" />
  <item value="00009" display="180" />
</items>
  • “1. Application for materials” Process, “Number of items taken out” input check (JavaScript)
1. Application for materials
<script>
let selects;
let stockCount;
let takingOutCount;
let remaindingCount;
function user_setStockCount(e) {
  let stockCount_ele = document.getElementsByName("data[3].selects");
  stockCount_ele[0].disabled = false;
  selects = qbpms.form.get("q_promotional_items");
  if (selects.length !== 0){
    qbpms.form.set("q_stock_count", selects[0].value);
  }
  stockCount_ele[0].disabled = true;
}
function user_checkTakingOutCount(e) {
  let button_ele = document.getElementById("submitButton");
  let remaindingCount_ele = document.getElementsByName("data[20].input");
  remaindingCount_ele[0].disabled = false;
  remaindingCount = getRemaindingCount();
  qbpms.form.set("q_remainding_count" , remaindingCount);
  remaindingCount_ele[0].disabled = true;
  if (remaindingCount < 0){
      alert("Please re-enter the number of items to be taken out. \nNumber of items taken out > Number of items in stock");
      button_ele.disabled = true;
  }else{
      button_ele.disabled = false;
  }
}
function user_checkTakingOutCountForSubmit(e) {
  let button_ele = document.getElementById("submitButton");
  let remaindingCount_ele = document.getElementsByName("data[20].input");
  let stockCount_ele = document.getElementsByName("data[3].selects");
  remaindingCount_ele[0].disabled = false;
  remaindingCount = getRemaindingCount();
  qbpms.form.set("q_remainding_count" , remaindingCount);
  if (remaindingCount < 0){
      alert("Please re-enter the number of items to be taken out.\n Number of items taken out > Number of items in stock");
      button_ele.disabled = true;
  }else{
      button_ele.disabled = false;
      stockCount_ele[0].disabled = false;
  }
}
function user_readyHandler(e) {
  let button_ele = document.getElementById("submitButton");
  let remaindingCount_ele = document.getElementsByName("data[20].input");
  let stockCount_ele = document.getElementsByName("data[3].selects");
  selects = qbpms.form.get("q_promotional_items");
  if (selects.length !== 0){
  qbpms.form.set("q_stock_count", selects[0].value);
  }
  stockCount_ele[0].disabled = true;
  remaindingCount_ele[0].disabled = true;
  button_ele.addEventListener('click', user_checkTakingOutCountForSubmit);
}
function getRemaindingCount(){
  selects = qbpms.form.get("q_stock_count");
  if (selects.length === 0){
  stockCount = 0;
  }else{
  stockCount = Number(selects[0].display);
  }
  takingOutCount = Number(qbpms.form.get("q_taking_out_count"));
  return stockCount - takingOutCount;
}
qbpms.form.on('ready', user_readyHandler);
qbpms.form.on('change', 'q_promotional_items', user_setStockCount);
qbpms.form.on('change', 'q_taking_out_count', user_checkTakingOutCount);
</script>

See also

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: