{ "edges": [ { "id": "start-1751870920411-form-1752471000000-1752110219601", "data": {}, "type": "smoothstep", "label": "", "source": "start-1751870920411", "target": "form-1752471000000", "animated": true, "sourceHandle": "start-1751870920411-right", "targetHandle": "form-1752471000000-left" }, { "id": "form-1752471000000-api-1752471000010-1752110221444", "data": {}, "type": "smoothstep", "label": "", "source": "form-1752471000000", "target": "api-1752471000010", "animated": true, "sourceHandle": "form-1752471000000-bottom", "targetHandle": "api-1752471000010-top" }, { "id": "api-1752471000010-script-1752471000020-1752110222889", "data": {}, "type": "smoothstep", "label": "", "source": "api-1752471000010", "target": "script-1752471000020", "animated": true, "sourceHandle": "api-1752471000010-right", "targetHandle": "script-1752471000020-left" }, { "id": "script-1752471000020-form-1751870928350-1752110513125", "data": {}, "type": "smoothstep", "label": "", "source": "script-1752471000020", "target": "form-1751870928350", "animated": true, "sourceHandle": "script-1752471000020-right", "targetHandle": "form-1751870928350-left" }, { "id": "form-1751870928350-api-1751871528249-1752110547688", "data": {}, "type": "smoothstep", "label": "", "source": "form-1751870928350", "target": "api-1751871528249", "animated": true, "sourceHandle": "form-1751870928350-bottom", "targetHandle": "api-1751871528249-top" }, { "id": "api-1751871528249-script-1751871635000-1752110661170", "data": {}, "type": "smoothstep", "label": "", "source": "api-1751871528249", "target": "script-1751871635000", "animated": true, "sourceHandle": "api-1751871528249-right", "targetHandle": "script-1751871635000-left" }, { "id": "start-1751870920411-form-1753000000000-1752115210580", "data": {}, "type": "smoothstep", "label": "", "source": "start-1751870920411", "target": "form-1753000000000", "animated": true, "sourceHandle": "start-1751870920411-right", "targetHandle": "form-1753000000000-left" }, { "id": "form-1753000000000-api-1753000000001-1752115217959", "data": {}, "type": "smoothstep", "label": "", "source": "form-1753000000000", "target": "api-1753000000001", "animated": true, "sourceHandle": "form-1753000000000-bottom", "targetHandle": "api-1753000000001-top" }, { "id": "api-1753000000001-script-1753000000002-1752115222952", "data": {}, "type": "smoothstep", "label": "", "source": "api-1753000000001", "target": "script-1753000000002", "animated": true, "sourceHandle": "api-1753000000001-right", "targetHandle": "script-1753000000002-left" }, { "id": "script-1753000000002-gateway-1753100000000-1752202680793", "data": {}, "type": "smoothstep", "label": "", "source": "script-1753000000002", "target": "gateway-1753100000000", "animated": true, "sourceHandle": "script-1753000000002-right", "targetHandle": "gateway-1753100000000-left" }, { "id": "gateway-1753100000000-form-1751870928350-1752202820616", "data": {}, "type": "smoothstep", "label": "Tidak", "source": "gateway-1753100000000", "target": "form-1751870928350", "animated": true, "sourceHandle": "gateway-1753100000000-right", "targetHandle": "form-1751870928350-left" }, { "id": "form-1753100000001-gateway-1753100000002-1752202841767", "data": {}, "type": "smoothstep", "label": "", "source": "form-1753100000001", "target": "gateway-1753100000002", "animated": true, "sourceHandle": "form-1753100000001-right", "targetHandle": "gateway-1753100000002-left" }, { "id": "gateway-1753100000002-subprocess-1753100000003-1752202973206", "data": {}, "type": "smoothstep", "label": "Ya", "source": "gateway-1753100000002", "target": "subprocess-1753100000003", "animated": true, "sourceHandle": "gateway-1753100000002-right", "targetHandle": "subprocess-1753100000003-left" }, { "id": "gateway-1753100000000-form-1753100000001-1752203198190", "data": {}, "type": "smoothstep", "label": "Ya", "source": "gateway-1753100000000", "target": "form-1753100000001", "animated": true, "sourceHandle": "gateway-1753100000000-right", "targetHandle": "form-1753100000001-top" }, { "id": "script-1751871635000-form-family-tree-choice-1752204006162", "data": {}, "type": "smoothstep", "label": "", "source": "script-1751871635000", "target": "form-family-tree-choice", "animated": true, "sourceHandle": "script-1751871635000-right", "targetHandle": "form-family-tree-choice-left" }, { "id": "form-family-tree-choice-gateway-family-tree-choice-1752204014461", "data": {}, "type": "smoothstep", "label": "", "source": "form-family-tree-choice", "target": "gateway-family-tree-choice", "animated": true, "sourceHandle": "form-family-tree-choice-bottom", "targetHandle": "gateway-family-tree-choice-left" }, { "id": "gateway-family-tree-choice-api-1752114771983-1752204050925", "data": {}, "type": "smoothstep", "label": "Ya", "source": "gateway-family-tree-choice", "target": "api-1752114771983", "animated": true, "sourceHandle": "gateway-family-tree-choice-right", "targetHandle": "api-1752114771983-left" }, { "id": "api-1752114771983-html-1752109761532-1752204167660", "data": {}, "type": "smoothstep", "label": "", "source": "api-1752114771983", "target": "html-1752109761532", "animated": true, "sourceHandle": "api-1752114771983-bottom", "targetHandle": "html-1752109761532-left" }, { "id": "gateway-family-tree-choice-form-kategori-asnaf-1752204312974", "data": {}, "type": "smoothstep", "label": "Tidak", "source": "gateway-family-tree-choice", "target": "form-kategori-asnaf", "animated": true, "sourceHandle": "gateway-family-tree-choice-right", "targetHandle": "form-kategori-asnaf-top" }, { "id": "form-kategori-asnaf-gateway-fakir-miskin-choice-1752204332412", "data": {}, "type": "smoothstep", "label": "", "source": "form-kategori-asnaf", "target": "gateway-fakir-miskin-choice", "animated": true, "sourceHandle": "form-kategori-asnaf-bottom", "targetHandle": "gateway-fakir-miskin-choice-left" }, { "id": "gateway-1753100000002-subprocess-1752202751327-1752204374213", "data": {}, "type": "smoothstep", "label": "Tidak", "source": "gateway-1753100000002", "target": "subprocess-1752202751327", "animated": true, "sourceHandle": "gateway-1753100000002-right", "targetHandle": "subprocess-1752202751327-left" }, { "id": "gateway-fakir-miskin-choice-business-rule-1751871900000-1752204422657", "data": {}, "type": "smoothstep", "label": "Ya", "source": "gateway-fakir-miskin-choice", "target": "business-rule-1751871900000", "animated": true, "sourceHandle": "gateway-fakir-miskin-choice-right", "targetHandle": "business-rule-1751871900000-left" }, { "id": "business-rule-1751871900000-business-rule-1751871901000-1752206876221", "data": {}, "type": "smoothstep", "label": "", "source": "business-rule-1751871900000", "target": "business-rule-1751871901000", "animated": true, "sourceHandle": "business-rule-1751871900000-bottom", "targetHandle": "business-rule-1751871901000-top" }, { "id": "business-rule-1751871901000-notification-1753200000002-1752207615091", "data": {}, "type": "smoothstep", "label": "", "source": "business-rule-1751871901000", "target": "notification-1753200000002", "animated": true, "sourceHandle": "business-rule-1751871901000-right", "targetHandle": "notification-1753200000002-top" }, { "id": "business-rule-1751871901000-form-pengesahan-1752207621840", "data": {}, "type": "smoothstep", "label": "", "source": "business-rule-1751871901000", "target": "form-pengesahan", "animated": true, "sourceHandle": "business-rule-1751871901000-bottom", "targetHandle": "form-pengesahan-top" }, { "id": "api-pengesahan-submit-form-pengesahan-1752208003574", "data": {}, "type": "smoothstep", "label": "", "source": "api-pengesahan-submit", "target": "form-pengesahan", "animated": true, "sourceHandle": "api-pengesahan-submit-right", "targetHandle": "form-pengesahan-left" }, { "id": "script-process-pengesahan-api-pengesahan-submit-1752208004921", "data": {}, "type": "smoothstep", "label": "", "source": "script-process-pengesahan", "target": "api-pengesahan-submit", "animated": true, "sourceHandle": "script-process-pengesahan-bottom", "targetHandle": "api-pengesahan-submit-top" }, { "id": "gateway-status-check-subprocess-1752202751327-berjaya-fm", "data": {}, "type": "smoothstep", "label": "Berjaya FM", "source": "gateway-status-check", "target": "subprocess-1752202751327", "animated": true, "sourceHandle": "gateway-status-check-right", "targetHandle": "subprocess-1752202751327-left" }, { "id": "gateway-status-check-notification-1753200000002-berjaya-miskin", "data": {}, "type": "smoothstep", "label": "Berjaya Miskin", "source": "gateway-status-check", "target": "notification-1753200000002", "animated": true, "sourceHandle": "gateway-status-check-bottom", "targetHandle": "notification-1753200000002-left" }, { "id": "gateway-status-check-notification-1753200000002-berjaya-non-fm", "data": {}, "type": "smoothstep", "label": "Berjaya Non-FM", "source": "gateway-status-check", "target": "notification-1753200000002", "animated": true, "sourceHandle": "gateway-status-check-top", "targetHandle": "notification-1753200000002-left" }, { "id": "gateway-status-check-notification-1753200000002-gagal", "data": {}, "type": "smoothstep", "label": "Gagal", "source": "gateway-status-check", "target": "notification-1753200000002", "animated": true, "sourceHandle": "gateway-status-check-left", "targetHandle": "notification-1753200000002-left" }, { "id": "script-process-pengesahan-gateway-status-check-1752208100000", "data": {}, "type": "smoothstep", "label": "", "source": "script-process-pengesahan", "target": "gateway-status-check", "animated": true, "sourceHandle": "script-process-pengesahan-right", "targetHandle": "gateway-status-check-left" } ], "nodes": [ { "id": "gateway-family-tree-choice", "data": { "label": "Lihat Family Tree?", "shape": "diamond", "textColor": "#374151", "conditions": [ { "id": "condition-group-ya-path", "output": "Ya", "conditions": [ { "id": "condition-1", "value": "ya", "operator": "eq", "variable": "lihatFamilyTree", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-tidak-path", "output": "Tidak", "conditions": [ { "id": "condition-2", "value": "tidak", "operator": "eq", "variable": "lihatFamilyTree", "valueType": "string", "logicalOperator": "and" } ] } ], "borderColor": "#6b7280", "defaultPath": "gateway-fakir-miskin-choice", "description": "Choose whether to view family tree", "gatewayType": "exclusive", "backgroundColor": "#f9fafb" }, "type": "gateway", "label": "Lihat Family Tree?", "position": { "x": 2070, "y": -345 } }, { "id": "form-family-tree-choice", "data": { "label": "Pilihan Family Tree", "formId": 6, "formName": "Pilihan Family Tree", "formUuid": "6e07fc8f-a160-478a-85fd-fa3364401547", "description": "Form untuk memilih sama ada mahu lihat family tree atau tidak", "assignedRoles": [], "assignedUsers": [], "inputMappings": [ { "formField": "nama_pemohon", "processVariable": "applicantName" } ], "assignmentType": "public", "outputMappings": [ { "formField": "lihat_family_tree", "processVariable": "lihatFamilyTree" } ], "fieldConditions": [] }, "type": "form", "label": "Pilihan Family Tree", "position": { "x": 2040, "y": -540 } }, { "id": "gateway-fakir-miskin-choice", "data": { "label": "Fakir Miskin?", "shape": "diamond", "textColor": "#333333", "conditions": [ { "id": "condition-group-ya-path", "output": "Ya", "conditions": [ { "id": "condition-1", "value": "fakir_miskin", "operator": "eq", "variable": "kategoriAsnaf", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-tidak-path", "output": "Tidak", "conditions": [ { "id": "condition-2", "value": "bukan_fakir_miskin", "operator": "eq", "variable": "kategoriAsnaf", "valueType": "string", "logicalOperator": "and" } ] } ], "borderColor": "#6b7280", "defaultPath": "business-rule-1751871900000", "description": "Determine if applicant is Fakir Miskin", "gatewayType": "exclusive", "backgroundColor": "#f9fafb" }, "type": "gateway", "label": "Fakir Miskin?", "position": { "x": 2085, "y": 210 } }, { "id": "form-kategori-asnaf", "data": { "label": "Pilihan Kategori Asnaf", "formId": 7, "formName": "Pilihan Kategori Asnaf", "formUuid": "7e07fc8f-a160-478a-85fd-fa3364401548", "description": "Form untuk memilih kategori asnaf", "assignedRoles": [], "assignedUsers": [], "inputMappings": [ { "formField": "nama_pemohon", "processVariable": "applicantName" } ], "assignmentType": "public", "outputMappings": [ { "formField": "kategori_asnaf", "processVariable": "kategoriAsnaf" } ], "fieldConditions": [] }, "type": "form", "label": "Pilihan Kategori Asnaf", "position": { "x": 2055, "y": -30 } }, { "id": "start-1751870920411", "data": { "label": "Start", "description": "Process start point" }, "type": "start", "label": "Start", "position": { "x": -75, "y": -510 } }, { "id": "form-1752471000000", "data": { "label": "Penilaian Awal", "formId": 3, "formName": "Penilaian Awal", "formUuid": "8e07fc8f-a160-478a-85fd-fa3364401544", "description": "Form: Penilaian Awal untuk permohonan bantuan", "assignedRoles": [], "assignedUsers": [], "inputMappings": [], "assignmentType": "public", "outputMappings": [ { "formField": "komitmen_pembiayaan", "processVariable": "komitmenKosTinggi" }, { "formField": "keperluan_mendesak", "processVariable": "keperluanMendesak" }, { "formField": "keperluan_lain_nyatakan", "processVariable": "keperluanLainNyatakan" }, { "formField": "dokumen_berkaitan", "processVariable": "dokumenBerkaitan" }, { "formField": "catatan_tambahan", "processVariable": "catatanTambahan" } ], "fieldConditions": [], "assignmentVariable": "", "assignmentVariableType": "user_id" }, "type": "form", "label": "Penilaian Awal", "position": { "x": 435, "y": -540 } }, { "id": "api-1752471000010", "data": { "label": "Submit Penilaian Awal API", "apiUrl": "https://jsonplaceholder.typicode.com/posts", "headers": "{ \"Content-Type\": \"application/json\" }", "apiMethod": "POST", "description": "Submit penilaian awal data to external system", "requestBody": "{\n \"komitmenKosTinggi\": \"{komitmenKosTinggi}\",\n \"keperluanMendesak\": \"{keperluanMendesak}\",\n \"keperluanLainNyatakan\": \"{keperluanLainNyatakan}\",\n \"dokumenBerkaitan\": \"{dokumenBerkaitan}\",\n \"catatanTambahan\": \"{catatanTambahan}\"\n}", "errorVariable": "penilaianAwalApiError", "outputVariable": "penilaianAwalApiResponse", "continueOnError": false }, "type": "api", "label": "Submit Penilaian Awal API", "position": { "x": 435, "y": -345 } }, { "id": "script-1752471000020", "data": { "label": "Process Penilaian Awal Response", "scriptCode": "// Extract important data from Penilaian Awal API response\nconst apiData = processVariables.penilaianAwalApiResponse;\n\nif (apiData && apiData.data) {\n // Generate a reference number for the assessment\n processVariables.penilaianAwalId = apiData.data.id || 'PA-' + Date.now();\n \n // Process the high cost commitment answer\n processVariables.hasHighCostCommitment = processVariables.komitmenKosTinggi === 'ya';\n \n // Process urgent needs\n if (Array.isArray(processVariables.keperluanMendesak)) {\n // Set flags for specific urgent needs\n processVariables.hasUrgentMedicalNeed = processVariables.keperluanMendesak.includes('perubatan_kritikal');\n processVariables.hasDisasterNeed = processVariables.keperluanMendesak.includes('bencana');\n processVariables.hasDeathRelatedNeed = processVariables.keperluanMendesak.includes('kematian');\n processVariables.hasFamilyConflict = processVariables.keperluanMendesak.includes('konflik_keluarga');\n processVariables.hasHomelessness = processVariables.keperluanMendesak.includes('tiada_tempat_tinggal');\n processVariables.hasUtilityArrears = processVariables.keperluanMendesak.includes('tunggakan_utiliti');\n processVariables.hasOtherNeeds = processVariables.keperluanMendesak.includes('lain_lain');\n processVariables.hasNoUrgentNeeds = processVariables.keperluanMendesak.includes('tidak_mendesak');\n \n // Calculate urgency score based on selected needs\n let urgencyScore = 0;\n if (processVariables.hasUrgentMedicalNeed) urgencyScore += 5;\n if (processVariables.hasDisasterNeed) urgencyScore += 5;\n if (processVariables.hasDeathRelatedNeed) urgencyScore += 4;\n if (processVariables.hasFamilyConflict) urgencyScore += 3;\n if (processVariables.hasHomelessness) urgencyScore += 5;\n if (processVariables.hasUtilityArrears) urgencyScore += 2;\n if (processVariables.hasOtherNeeds) urgencyScore += 1;\n if (processVariables.hasNoUrgentNeeds) urgencyScore = 0;\n \n processVariables.urgencyScore = urgencyScore;\n processVariables.urgencyLevel = urgencyScore >= 5 ? 'high' : (urgencyScore >= 3 ? 'medium' : 'low');\n }\n \n // Check if documents were uploaded\n processVariables.hasUploadedDocuments = processVariables.dokumenBerkaitan && \n Array.isArray(processVariables.dokumenBerkaitan) && \n processVariables.dokumenBerkaitan.length > 0;\n \n // Set status for next step\n processVariables.penilaianAwalStatus = 'completed';\n processVariables.readyForPersonalInfo = true;\n \n console.log('Penilaian Awal processed successfully:', {\n penilaianAwalId: processVariables.penilaianAwalId,\n urgencyLevel: processVariables.urgencyLevel,\n urgencyScore: processVariables.urgencyScore,\n hasHighCostCommitment: processVariables.hasHighCostCommitment,\n hasUploadedDocuments: processVariables.hasUploadedDocuments\n });\n} else {\n // Handle API error case\n processVariables.penilaianAwalStatus = 'failed';\n processVariables.readyForPersonalInfo = false;\n processVariables.penilaianAwalError = 'Failed to submit penilaian awal';\n}", "description": "Process the penilaian awal form data and API response", "errorVariable": "penilaianAwalScriptError", "inputVariables": [ "penilaianAwalApiResponse", "komitmenKosTinggi", "keperluanMendesak", "keperluanLainNyatakan", "dokumenBerkaitan", "catatanTambahan" ], "scriptLanguage": "javascript", "continueOnError": false, "outputVariables": [ { "name": "penilaianAwalId", "type": "string", "description": "Generated ID for the initial assessment" }, { "name": "hasHighCostCommitment", "type": "boolean", "description": "Whether applicant has high cost commitments" }, { "name": "urgencyScore", "type": "number", "description": "Calculated urgency score based on needs" }, { "name": "urgencyLevel", "type": "string", "description": "Urgency level (high/medium/low)" }, { "name": "hasUrgentMedicalNeed", "type": "boolean", "description": "Whether applicant has urgent medical needs" }, { "name": "hasDisasterNeed", "type": "boolean", "description": "Whether applicant has disaster-related needs" }, { "name": "hasDeathRelatedNeed", "type": "boolean", "description": "Whether applicant has death-related needs" }, { "name": "hasFamilyConflict", "type": "boolean", "description": "Whether applicant has family conflict" }, { "name": "hasHomelessness", "type": "boolean", "description": "Whether applicant is homeless" }, { "name": "hasUtilityArrears", "type": "boolean", "description": "Whether applicant has utility arrears" }, { "name": "hasOtherNeeds", "type": "boolean", "description": "Whether applicant has other needs" }, { "name": "hasNoUrgentNeeds", "type": "boolean", "description": "Whether applicant has no urgent needs" }, { "name": "hasUploadedDocuments", "type": "boolean", "description": "Whether documents were uploaded" }, { "name": "penilaianAwalStatus", "type": "string", "description": "Status of initial assessment submission" }, { "name": "readyForPersonalInfo", "type": "boolean", "description": "Whether ready for personal info form" } ] }, "type": "script", "label": "Process Penilaian Awal Response", "position": { "x": 780, "y": -345 } }, { "id": "form-1751870928350", "data": { "label": "Borang Maklumat Peribadi", "formId": 1, "formName": "Borang Maklumat Peribadi", "formUuid": "9f08fc8f-b170-478a-85fd-fa3364401533", "description": "Form: Borang Maklumat Peribadi", "assignedRoles": [], "assignedUsers": [], "inputMappings": [], "assignmentType": "public", "outputMappings": [ { "formField": "text_3", "processVariable": "text3" }, { "formField": "select_1", "processVariable": "select1" }, { "formField": "form_jeniskp_1", "processVariable": "formJeniskp1" }, { "formField": "form_jeniskp_2", "processVariable": "formJeniskp2" }, { "formField": "form_jeniskp_3", "processVariable": "formJeniskp3" }, { "formField": "text_warganegara", "processVariable": "textWarganegara" }, { "formField": "radio_jantina", "processVariable": "radioJantina" }, { "formField": "radio_bangsa", "processVariable": "radioBangsa" }, { "formField": "nyatakan_lain2", "processVariable": "nyatakanLain2" }, { "formField": "radio_9_copy", "processVariable": "radio9Copy" }, { "formField": "radio_pendidikan", "processVariable": "radioPendidikan" }, { "formField": "text_14", "processVariable": "text14" }, { "formField": "date_masukislam", "processVariable": "dateMasukislam" }, { "formField": "date_masukislam_copy", "processVariable": "dateMasukislamCopy" }, { "formField": "select_statusperkahwinan", "processVariable": "selectStatusperkahwinan" }, { "formField": "hubungan_keluarga", "processVariable": "hubunganKeluarga" }, { "formField": "hubungan_lain_nyatakan", "processVariable": "hubunganLainNyatakan" }, { "formField": "nama_tanggungan", "processVariable": "namaTanggungan" }, { "formField": "jenis_kad_tanggungan", "processVariable": "jenisKadTanggungan" }, { "formField": "no_pengenalan_tanggungan", "processVariable": "noPengenalanTanggungan" }, { "formField": "jantina_tanggungan", "processVariable": "jantinaTanggungan" }, { "formField": "tarikh_lahir_tanggungan", "processVariable": "tarikhLahirTanggungan" }, { "formField": "tempat_lahir_tanggungan", "processVariable": "tempatLahirTanggungan" }, { "formField": "bangsa_tanggungan", "processVariable": "bangsaTanggungan" }, { "formField": "bangsa_lain_tanggungan", "processVariable": "bangsaLainTanggungan" }, { "formField": "status_kahwin_tanggungan", "processVariable": "statusKahwinTanggungan" }, { "formField": "tarikh_masuk_islam_tanggungan", "processVariable": "tarikhMasukIslamTanggungan" }, { "formField": "tarikh_mula_kfam_tanggungan", "processVariable": "tarikhMulaKfamTanggungan" }, { "formField": "warganegara_tanggungan", "processVariable": "warganegaraTanggungan" }, { "formField": "tempat_menetap_tanggungan", "processVariable": "tempatMenetapTanggungan" }, { "formField": "no_telefon_tanggungan", "processVariable": "noTelefonTanggungan" }, { "formField": "nama_pemegang_akaun", "processVariable": "namaPemegangAkaun" }, { "formField": "nama_bank", "processVariable": "namaBank" }, { "formField": "no_akaun_bank", "processVariable": "noAkaunBank" }, { "formField": "cara_pembayaran", "processVariable": "caraPembayaran" }, { "formField": "sebab_tunai", "processVariable": "sebabTunai" }, { "formField": "bersekolah_tanggungan", "processVariable": "bersekolahTanggungan" }, { "formField": "pendidikan_tertinggi_tanggungan", "processVariable": "pendidikanTertinggiTanggungan" }, { "formField": "pendidikan_lain_tanggungan", "processVariable": "pendidikanLainTanggungan" }, { "formField": "nama_sekolah", "processVariable": "namaSekolah" }, { "formField": "alamat_sekolah", "processVariable": "alamatSekolah" }, { "formField": "daerah_sekolah", "processVariable": "daerahSekolah" }, { "formField": "negeri_sekolah", "processVariable": "negeriSekolah" }, { "formField": "poskod_sekolah", "processVariable": "poskodSekolah" }, { "formField": "tinggal_bersama_keluarga", "processVariable": "tinggalBersamaKeluarga" } ], "fieldConditions": [], "assignmentVariable": "", "assignmentVariableType": "user_id" }, "type": "form", "label": "Borang Maklumat Peribadi", "position": { "x": 1260, "y": -540 } }, { "id": "api-1751871528249", "data": { "label": "Submit Profile API", "apiUrl": "https://jsonplaceholder.typicode.com/posts", "headers": "{ \"Content-Type\": \"application/json\" }", "apiMethod": "POST", "description": "Submit user profile to external system", "requestBody": "{\n \"applicantName\": \"{text3}\",\n \"idType\": \"{select1}\",\n \"mykadNumber\": \"{formJeniskp1}\",\n \"passportNumber\": \"{formJeniskp2}\",\n \"birthCertNumber\": \"{formJeniskp3}\",\n \"nationality\": \"{textWarganegara}\",\n \"gender\": \"{radioJantina}\",\n \"race\": \"{radioBangsa}\",\n \"otherRace\": \"{nyatakanLain2}\",\n \"isStudying\": \"{radio9Copy}\",\n \"education\": \"{radioPendidikan}\",\n \"otherEducation\": \"{text14}\",\n \"islamConversionDate\": \"{dateMasukislam}\",\n \"kfamStartDate\": \"{dateMasukislamCopy}\",\n \"maritalStatus\": \"{selectStatusperkahwinan}\",\n \"dependentInfo\": {\n \"relationship\": \"{hubunganKeluarga}\",\n \"otherRelationship\": \"{hubunganLainNyatakan}\",\n \"name\": \"{namaTanggungan}\",\n \"idType\": \"{jenisKadTanggungan}\",\n \"idNumber\": \"{noPengenalanTanggungan}\",\n \"gender\": \"{jantinaTanggungan}\",\n \"birthDate\": \"{tarikhLahirTanggungan}\",\n \"birthPlace\": \"{tempatLahirTanggungan}\",\n \"race\": \"{bangsaTanggungan}\",\n \"otherRace\": \"{bangsaLainTanggungan}\",\n \"maritalStatus\": \"{statusKahwinTanggungan}\",\n \"islamConversionDate\": \"{tarikhMasukIslamTanggungan}\",\n \"kfamStartDate\": \"{tarikhMulaKfamTanggungan}\",\n \"nationality\": \"{warganegaraTanggungan}\",\n \"residenceDuration\": \"{tempatMenetapTanggungan}\",\n \"phoneNumber\": \"{noTelefonTanggungan}\",\n \"isStudying\": \"{bersekolahTanggungan}\",\n \"education\": \"{pendidikanTertinggiTanggungan}\",\n \"otherEducation\": \"{pendidikanLainTanggungan}\",\n \"schoolName\": \"{namaSekolah}\",\n \"schoolAddress\": \"{alamatSekolah}\",\n \"schoolDistrict\": \"{daerahSekolah}\",\n \"schoolState\": \"{negeriSekolah}\",\n \"schoolPostcode\": \"{poskodSekolah}\",\n \"liveWithFamily\": \"{tinggalBersamaKeluarga}\"\n },\n \"bankingInfo\": {\n \"accountHolderName\": \"{namaPemegangAkaun}\",\n \"bankName\": \"{namaBank}\",\n \"accountNumber\": \"{noAkaunBank}\",\n \"paymentMethod\": \"{caraPembayaran}\",\n \"cashReason\": \"{sebabTunai}\"\n }\n}", "errorVariable": "apiError", "outputVariable": "apiResponse", "continueOnError": false }, "type": "api", "label": "Submit Profile API", "position": { "x": 1260, "y": -345 } }, { "id": "script-1751871635000", "data": { "label": "Process API Response", "scriptCode": "// Extract important data from API response\nconst apiData = processVariables.apiResponse;\n\nif (apiData && apiData.data) {\n // Extract application ID\n processVariables.applicationId = apiData.data.id || 'APP-' + Date.now();\n \n // Determine if documents are required based on profile\n processVariables.documentsRequired = true;\n \n // Set verification level based on education and other factors\n if (processVariables.radioPendidikan === 'ijazah' || processVariables.radioPendidikan === 'diploma') {\n processVariables.verificationLevel = 'enhanced';\n processVariables.documentsRequired = true;\n } else {\n processVariables.verificationLevel = 'standard';\n }\n \n // Extract applicant name for verification form\n processVariables.applicantName = processVariables.text3;\n \n // Process dependent information if available\n if (processVariables.namaTanggungan) {\n processVariables.hasDependents = true;\n processVariables.dependentCount = 1;\n processVariables.dependentName = processVariables.namaTanggungan;\n } else {\n processVariables.hasDependents = false;\n processVariables.dependentCount = 0;\n }\n \n // Process banking information\n if (processVariables.namaBank && processVariables.noAkaunBank) {\n processVariables.hasBankingInfo = true;\n processVariables.paymentReady = true;\n } else {\n processVariables.hasBankingInfo = false;\n processVariables.paymentReady = false;\n }\n \n // Set status for next step\n processVariables.profileSubmissionStatus = 'success';\n processVariables.nextStepReady = true;\n \n console.log('Profile processed successfully:', {\n applicationId: processVariables.applicationId,\n verificationLevel: processVariables.verificationLevel,\n documentsRequired: processVariables.documentsRequired,\n hasDependents: processVariables.hasDependents,\n hasBankingInfo: processVariables.hasBankingInfo\n });\n} else {\n // Handle API error case\n processVariables.profileSubmissionStatus = 'failed';\n processVariables.nextStepReady = false;\n processVariables.errorMessage = 'Failed to submit profile';\n}", "description": "Transform API response for document verification step", "errorVariable": "scriptError", "inputVariables": [ "apiResponse", "text3", "radioPendidikan", "namaTanggungan", "namaBank", "noAkaunBank" ], "scriptLanguage": "javascript", "continueOnError": false, "outputVariables": [ { "name": "applicationId", "type": "string", "description": "Generated application ID" }, { "name": "documentsRequired", "type": "boolean", "description": "Whether documents verification is required" }, { "name": "verificationLevel", "type": "string", "description": "Level of verification required" }, { "name": "applicantName", "type": "string", "description": "Applicant name for verification" }, { "name": "hasDependents", "type": "boolean", "description": "Whether applicant has dependents" }, { "name": "dependentCount", "type": "number", "description": "Number of dependents" }, { "name": "dependentName", "type": "string", "description": "Name of dependent" }, { "name": "hasBankingInfo", "type": "boolean", "description": "Whether banking information is provided" }, { "name": "paymentReady", "type": "boolean", "description": "Whether payment processing is ready" }, { "name": "profileSubmissionStatus", "type": "string", "description": "Status of profile submission" }, { "name": "nextStepReady", "type": "boolean", "description": "Whether ready for next step" } ] }, "type": "script", "label": "Process API Response", "position": { "x": 1590, "y": -345 } }, { "id": "business-rule-1751871900000", "data": { "label": "BF-NAS-PRF-AS-QS-03 Analisa Data (Had Kifayah)", "shape": "rectangle", "textColor": "#1e40af", "ruleGroups": [ { "id": "group-1", "name": "Ketua Keluarga Base Amount", "actions": [ { "id": "action-1-1", "type": "set_variable", "value": 1215, "variable": "baseKifayahKetuaKeluarga" }, { "id": "action-1-2", "type": "set_variable", "value": "ketua_keluarga", "variable": "categoryKetuaKeluarga" } ], "operator": "AND", "conditions": [ { "id": "condition-1-1", "value": "", "operator": "neq", "variable": "noKadPengenalan", "valueType": "string" } ] }, { "id": "group-2", "name": "Dewasa Bekerja (18 Tahun Ke Atas)", "actions": [ { "id": "action-2-1", "type": "set_variable", "value": 412, "variable": "hadKifayahDewasaBekerja" }, { "id": "action-2-2", "type": "calculation", "formula": "hadKifayahDewasaBekerja * bilanganDewasaBekerja", "variable": "totalHadKifayahDewasaBekerja" } ], "operator": "AND", "conditions": [ { "id": "condition-2-1", "value": 0, "operator": "gt", "variable": "bilanganDewasaBekerja" } ] }, { "id": "group-3", "name": "Dewasa Tidak Bekerja (18 Tahun Ke Atas)", "actions": [ { "id": "action-3-1", "type": "set_variable", "value": 167, "variable": "hadKifayahDewasaTidakBekerja" }, { "id": "action-3-2", "type": "calculation", "formula": "hadKifayahDewasaTidakBekerja * bilanganDewasaTidakBekerja", "variable": "totalHadKifayahDewasaTidakBekerja" } ], "operator": "AND", "conditions": [ { "id": "condition-3-1", "value": 0, "operator": "gt", "variable": "bilanganDewasaTidakBekerja" } ] }, { "id": "group-4", "name": "Tanggungan Belajar IPT", "actions": [ { "id": "action-4-1", "type": "set_variable", "value": 613, "variable": "hadKifayahTanggunganIPT" }, { "id": "action-4-2", "type": "calculation", "formula": "hadKifayahTanggunganIPT * bilanganTanggunganIPT", "variable": "totalHadKifayahTanggunganIPT" } ], "operator": "AND", "conditions": [ { "id": "condition-4-1", "value": 0, "operator": "gt", "variable": "bilanganTanggunganIPT" } ] }, { "id": "group-5", "name": "Tanggungan Berumur 7-17 tahun", "actions": [ { "id": "action-5-1", "type": "set_variable", "value": 408, "variable": "hadKifayahTanggungan7to17" }, { "id": "action-5-2", "type": "calculation", "formula": "hadKifayahTanggungan7to17 * bilanganTanggungan7to17", "variable": "totalHadKifayahTanggungan7to17" } ], "operator": "AND", "conditions": [ { "id": "condition-5-1", "value": 0, "operator": "gt", "variable": "bilanganTanggungan7to17" } ] }, { "id": "group-6", "name": "Tanggungan 6 Tahun Ke Bawah", "actions": [ { "id": "action-6-1", "type": "set_variable", "value": 175, "variable": "hadKifayahTanggungan6KeBawah" }, { "id": "action-6-2", "type": "calculation", "formula": "hadKifayahTanggungan6KeBawah * bilanganTanggungan6KeBawah", "variable": "totalHadKifayahTanggungan6KeBawah" } ], "operator": "AND", "conditions": [ { "id": "condition-6-1", "value": 0, "operator": "gt", "variable": "bilanganTanggungan6KeBawah" } ] }, { "id": "group-7", "name": "Calculate Total Had Kifayah", "actions": [ { "id": "action-7-1", "type": "calculation", "formula": "baseKifayahKetuaKeluarga + (totalHadKifayahDewasaBekerja || 0) + (totalHadKifayahDewasaTidakBekerja || 0) + (totalHadKifayahTanggunganIPT || 0) + (totalHadKifayahTanggungan7to17 || 0) + (totalHadKifayahTanggungan6KeBawah || 0)", "variable": "totalJumlahHadKifayah" }, { "id": "action-7-2", "type": "calculation", "formula": "((pendapatanBersih || 0) / totalJumlahHadKifayah) * 100", "variable": "peratusHadKifayah" }, { "id": "action-7-3", "type": "set_variable", "value": "completed", "variable": "kifayahCalculationStatus" } ], "operator": "AND", "conditions": [ { "id": "condition-7-1", "value": "", "operator": "neq", "variable": "noKadPengenalan" } ] } ], "borderColor": "#3b82f6", "description": "BF-NAS-PRF-AS-QS-03: Proses pengiraan had kifayah asnaf menggunakan maklumat konfigurasi had kifayah dan maklumat yang telah diisi oleh pemohon/pendaftar", "errorVariable": "kifayahCalculationError", "outputVariable": "kifayahCalculationResult", "backgroundColor": "#eff6ff" }, "type": "business-rule", "label": "BF-NAS-PRF-AS-QS-03 Analisa Data (Had Kifayah)", "position": { "x": 2505, "y": -60 } }, { "id": "business-rule-1751871901000", "data": { "label": "BF-NAS-PRF-AS-QS-04 Syor Status Keluarga Asnaf", "shape": "rectangle", "textColor": "#1e40af", "ruleGroups": [ { "id": "group-status-1", "name": "Kategorikan Fakir (0%-49.9%)", "actions": [ { "id": "action-status-1-1", "type": "set_variable", "value": "Fakir", "variable": "kategoriKeluargaAsna" }, { "id": "action-status-1-2", "type": "set_variable", "value": "Fakir", "variable": "kategoriAsnafSyor" }, { "id": "action-status-1-3", "type": "set_variable", "value": "Fakir", "variable": "statusKeluarga" } ], "operator": "AND", "conditions": [ { "id": "condition-status-1-1", "value": 0, "operator": "gte", "variable": "peratusHadKifayah" }, { "id": "condition-status-1-2", "value": 49.9, "operator": "lte", "variable": "peratusHadKifayah" } ] }, { "id": "group-status-2", "name": "Kategorikan Miskin (50%-100%)", "actions": [ { "id": "action-status-2-1", "type": "set_variable", "value": "Miskin", "variable": "kategoriKeluargaAsnaf" }, { "id": "action-status-2-2", "type": "set_variable", "value": "Miskin", "variable": "kategoriAsnafSyor" }, { "id": "action-status-2-3", "type": "set_variable", "value": "Miskin", "variable": "statusKeluarga" } ], "operator": "AND", "conditions": [ { "id": "condition-status-2-1", "value": 50, "operator": "gte", "variable": "peratusHadKifayah" }, { "id": "condition-status-2-2", "value": 100, "operator": "lte", "variable": "peratusHadKifayah" } ] }, { "id": "group-status-3", "name": "Kategorikan Non-FM (>100%)", "actions": [ { "id": "action-status-3-1", "type": "set_variable", "value": "Non-FM", "variable": "kategoriKeluargaAsnaf" }, { "id": "action-status-3-2", "type": "set_variable", "value": "Non-FM", "variable": "kategoriAsnafSyor" }, { "id": "action-status-3-3", "type": "set_variable", "value": "Non-FM", "variable": "statusKeluarga" } ], "operator": "AND", "conditions": [ { "id": "condition-status-3-1", "value": 100, "operator": "gt", "variable": "peratusHadKifayah" } ] }, { "id": "group-status-4", "name": "Check Muallaf Status", "actions": [ { "id": "action-status-4-1", "type": "set_variable", "value": "Muallaf", "variable": "kategoriAsnafSyor" }, { "id": "action-status-4-2", "type": "set_variable", "value": "Muallaf", "variable": "statusIndividu" } ], "operator": "AND", "conditions": [ { "id": "condition-status-4-1", "value": "", "operator": "neq", "variable": "dateMasukislam" }, { "id": "condition-status-4-2", "value": 5, "operator": "lt", "variable": "tempohMasukIslam" } ] }, { "id": "group-status-5", "name": "Generate AI Recommendation", "actions": [ { "id": "action-status-5-1", "type": "set_variable", "value": "Generated", "variable": "syorPengesahanStatus" }, { "id": "action-status-5-2", "type": "set_variable", "value": "${new Date().toISOString()}", "variable": "tarikhPengesyoran" }, { "id": "action-status-5-3", "type": "set_variable", "value": "Berdasarkan analisis had kifayah, pemohon dikategorikan sebagai ${kategoriAsnafSyor} dengan peratus had kifayah ${peratusHadKifayah.toFixed(2)}%. Jumlah had kifayah keluarga: RM ${totalJumlahHadKifayah.toFixed(2)}.", "variable": "syorPengesahan" } ], "operator": "AND", "conditions": [ { "id": "condition-status-5-1", "value": "completed", "operator": "eq", "variable": "kifayahCalculationStatus" } ] } ], "borderColor": "#3b82f6", "description": "BF-NAS-PRF-AS-QS-04: Sistem akan mengesyorkan status keluarga asnaf hasil dari pengiraan had kifayah", "errorVariable": "statusRecommendationError", "outputVariable": "statusRecommendationResult", "backgroundColor": "#eff6ff" }, "type": "business-rule", "label": "BF-NAS-PRF-AS-QS-04 Syor Status Keluarga Asnaf", "position": { "x": 2505, "y": 195 } }, { "id": "html-1752109761532", "data": { "label": "Family Tree", "shape": "rectangle", "jsCode": "", "cssCode": "", "htmlCode": "\n
\n

Custom HTML Content

\n

This is a custom HTML node that can display rich content.

\n
", "textColor": "#333333", "autoRefresh": false, "borderColor": "#dddddd", "description": "Family Tree for Borang", "inputVariables": [], "backgroundColor": "#ffffff", "outputVariables": [], "allowVariableAccess": true }, "type": "html", "label": "Family Tree", "position": { "x": 2535, "y": -435 } }, { "id": "rectangle-shape-1752110224921", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "isShape": true, "shapeType": "rectangle", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "rectangle-shape", "label": "", "position": { "x": 375, "y": -570 } }, { "id": "text-annotation-1752110279700", "data": { "label": "NF-NAS-PRF-AS-PA", "shape": "rectangle", "width": 200, "height": 80, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Pernilaian Awal", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-PA", "position": { "x": 810, "y": -555 } }, { "id": "rectangle-shape-1752110492897", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "isShape": true, "shapeType": "rectangle", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "rectangle-shape", "label": "", "position": { "x": 1185, "y": -570 } }, { "id": "text-annotation-1752110562983", "data": { "label": "BF-NAS-PRF-AS-QS-02", "shape": "rectangle", "width": 200, "height": 80, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Isi Borang Permohonan Online", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-QS-02", "position": { "x": 1620, "y": -555 } }, { "id": "rectangle-shape-1752114739551", "data": { "label": "", "shape": "rectangle", "width": 750, "height": 400, "isShape": true, "shapeType": "rectangle", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "rectangle-shape", "label": "", "position": { "x": 1995, "y": -570 } }, { "id": "api-1752114771983", "data": { "label": "API Call", "shape": "rectangle", "apiUrl": "", "headers": "{ \"Content-Type\": \"application/json\" }", "apiMethod": "GET", "textColor": "#1e40af", "borderColor": "#3b82f6", "description": "External API call", "requestBody": "", "errorVariable": "apiError", "outputVariable": "apiResponse", "backgroundColor": "#eff6ff", "continueOnError": false }, "type": "api", "label": "Called Family Tree", "position": { "x": 2295, "y": -525 } }, { "id": "text-annotation-1752114833800", "data": { "label": "", "shape": "rectangle", "width": 200, "height": 80, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Family Tree", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-FM", "position": { "x": 2520, "y": -555 } }, { "id": "form-1753000000000", "data": { "label": "Carian Profil", "formId": 4, "formName": "Carian Profil", "formUuid": "4e07fc8f-a160-478a-85fd-fa3364401545", "description": "Skrin carian asnaf atau login", "assignedRoles": [], "assignedUsers": [], "inputMappings": [], "assignmentType": "public", "outputMappings": [ { "formField": "search_type", "processVariable": "carianSearchType" }, { "formField": "search_id", "processVariable": "carianSearchId" }, { "formField": "login_id", "processVariable": "carianLoginId" }, { "formField": "login_password", "processVariable": "carianLoginPassword" } ], "fieldConditions": [], "assignmentVariable": "", "assignmentVariableType": "user_id" }, "type": "form", "label": "Carian Profil", "position": { "x": 450, "y": -15 } }, { "id": "api-1753000000001", "data": { "label": "Submit Carian Profil API", "apiUrl": "https://api.example.com/profiles/search", "headers": "{ \"Content-Type\": \"application/json\" }", "apiMethod": "POST", "description": "Submit profile search or login credentials", "requestBody": "{\n \"searchType\": \"{carianSearchType}\",\n \"searchId\": \"{carianSearchId}\",\n \"loginId\": \"{carianLoginId}\",\n \"password\": \"{carianLoginPassword}\"\n}", "errorVariable": "carianProfilApiError", "outputVariable": "carianProfilApiResponse", "continueOnError": false }, "type": "api", "label": "Submit Carian Profil API", "position": { "x": 450, "y": 180 } }, { "id": "script-1753000000002", "data": { "label": "Process Carian Profil Response", "scriptCode": "// Process API response from profile search/login\nconst response = processVariables.carianProfilApiResponse;\n\nif (response && response.data) {\n if (response.data.loginSuccess) {\n processVariables.loginSuccess = true;\n processVariables.profileData = response.data.profile;\n processVariables.carianProfilStatus = 'login_successful';\n } else if (response.data.profileFound) {\n processVariables.profileFound = true;\n processVariables.profileData = response.data.profile;\n processVariables.carianProfilStatus = 'profile_found';\n } else {\n processVariables.profileFound = false;\n processVariables.loginSuccess = false;\n processVariables.carianProfilStatus = 'not_found';\n }\n} else {\n processVariables.carianProfilStatus = 'error';\n processVariables.carianProfilScriptError = 'Invalid or empty API response';\n}", "description": "Process the response from the Carian Profil API", "errorVariable": "carianProfilScriptError", "inputVariables": ["carianProfilApiResponse"], "scriptLanguage": "javascript", "continueOnError": false, "outputVariables": [ { "name": "profileFound", "type": "boolean", "description": "Indicates if a profile was found via search" }, { "name": "loginSuccess", "type": "boolean", "description": "Indicates if the asnaf login was successful" }, { "name": "profileData", "type": "object", "description": "The retrieved profile data" }, { "name": "carianProfilStatus", "type": "string", "description": "The status of the profile search/login action" } ] }, "type": "script", "label": "Process Carian Profil Response", "position": { "x": 780, "y": 180 } }, { "id": "rectangle-shape-1752115136908", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "isShape": true, "shapeType": "rectangle", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "rectangle-shape", "label": "", "position": { "x": 375, "y": -45 } }, { "id": "text-annotation-1752115184991", "data": { "label": "", "shape": "rectangle", "width": 200, "height": 80, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Carian Profil", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-QS-01", "position": { "x": 810, "y": -30 } }, { "id": "gateway-1753100000000", "data": { "label": "Profil Wujud?", "shape": "diamond", "textColor": "#374151", "conditions": [ { "id": "condition-group-ya-path", "output": "Ya", "conditions": [ { "id": "condition-1", "value": true, "operator": "eq", "variable": "profileFound", "valueType": "boolean", "logicalOperator": "and" } ] }, { "id": "condition-group-tidak-path", "output": "Tidak", "conditions": [ { "id": "condition-2", "value": false, "operator": "eq", "variable": "profileFound", "valueType": "boolean", "logicalOperator": "and" } ] } ], "borderColor": "#6b7280", "defaultPath": "form-1752471000000", "description": "Check if profile exists in system", "gatewayType": "exclusive", "backgroundColor": "#f9fafb" }, "type": "gateway", "label": "Profil Wujud?", "position": { "x": 1230, "y": 0 } }, { "id": "form-1753100000001", "data": { "label": "Pengesahan Kemaskini Profil", "formId": 5, "formName": "Pengesahan Kemaskini Profil", "formUuid": "5e07fc8f-a160-478a-85fd-fa3364401546", "description": "Borang pengesahan untuk kemaskini profil sedia ada", "assignedRoles": [], "assignedUsers": [], "inputMappings": [ { "formField": "nama_pemohon", "processVariable": "profileData.nama" }, { "formField": "no_kad_pengenalan", "processVariable": "profileData.noKadPengenalan" }, { "formField": "tarikh_lahir", "processVariable": "profileData.tarikhLahir" }, { "formField": "alamat", "processVariable": "profileData.alamat" } ], "assignmentType": "public", "outputMappings": [ { "formField": "kemaskini_profil", "processVariable": "kemaskiniProfil" }, { "formField": "sebab_kemaskini", "processVariable": "sebabKemaskini" } ], "fieldConditions": [], "assignmentVariable": "", "assignmentVariableType": "user_id" }, "type": "form", "label": "Pengesahan Kemaskini Profil", "position": { "x": 1200, "y": 195 } }, { "id": "gateway-1753100000002", "data": { "label": "Perubahan Profil?", "shape": "diamond", "textColor": "#374151", "conditions": [ { "id": "condition-group-ya-path", "output": "Ya", "conditions": [ { "id": "condition-1", "value": "ya", "operator": "eq", "variable": "kemaskiniProfil", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-tidak-path", "output": "Tidak", "conditions": [ { "id": "condition-2", "value": "tidak", "operator": "eq", "variable": "kemaskiniProfil", "valueType": "string", "logicalOperator": "and" } ] } ], "borderColor": "#6b7280", "defaultPath": "form-1752471000000", "description": "Check if user wants to update profile", "gatewayType": "exclusive", "backgroundColor": "#f9fafb" }, "type": "gateway", "label": "Perubahan Profil?", "position": { "x": 1440, "y": 60 } }, { "id": "subprocess-1753100000003", "data": { "label": "BF-NAS-PRF-AS-UP-02", "shape": "rectangle", "processId": "kemaskini-profil-process", "textColor": "#134e4a", "borderColor": "#14b8a6", "description": "Sub Process: Kemaskini Profil", "subprocessId": 3, "inputMappings": [ { "processVariable": "profileData", "subprocessVariable": "profileData" }, { "processVariable": "sebabKemaskini", "subprocessVariable": "sebabKemaskini" } ], "outputMappings": [ { "processVariable": "updatedProfileData", "subprocessVariable": "profileData" }, { "processVariable": "profileUpdateStatus", "subprocessVariable": "updateStatus" } ], "subprocessName": "BF-NAS-PRF-AS-UP-02", "backgroundColor": "#f0fdfa" }, "type": "subprocess", "label": "BF-NAS-PRF-AS-UP-02", "position": { "x": 1635, "y": -30 } }, { "id": "subprocess-1752202751327", "data": { "label": "BF-NAS-BTN-PB", "shape": "rectangle", "textColor": "#134e4a", "borderColor": "#14b8a6", "description": "Sub Process: Bantuan", "subprocessId": 4, "subprocessName": "BF-NAS-BTN-PB", "backgroundColor": "#f0fdfa" }, "type": "subprocess", "label": "BF-NAS-BTN-PB", "position": { "x": 1635, "y": 180 } }, { "id": "notification-1753200000001", "data": { "label": "Terima Notifikasi", "message": "Assalamualaikum {applicantName},\n\nPermohonan bantuan anda telah diterima dan sedang dalam proses semakan.\n\nNo Rujukan: {applicationId}\nTarikh Permohonan: {submissionDate}\nStatus: Dalam Proses\n\nAnda akan menerima notifikasi lanjut apabila terdapat kemaskini status permohonan.\n\nTerima kasih.", "subject": "Permohonan Bantuan Diterima - {applicationId}", "priority": "normal", "template": "application_received", "variables": [ "applicantName", "applicationId", "submissionDate", "applicantEmail" ], "recipients": [ { "type": "variable", "value": "applicantEmail" }, { "type": "role", "value": "admin" } ], "attachments": [], "description": "Send notification when application is received", "sendImmediately": true, "notificationType": "email" }, "type": "notification", "label": "Terima Notifikasi", "position": { "x": 3180, "y": -435 } }, { "id": "gateway-status-check", "data": { "label": "Status", "shape": "diamond", "textColor": "#374151", "conditions": [ { "id": "condition-group-berjaya-fm-path", "output": "Berjaya FM", "conditions": [ { "id": "condition-1", "value": "approved", "operator": "eq", "variable": "applicationStatus", "valueType": "string", "logicalOperator": "and" }, { "id": "condition-2", "value": "Fakir", "operator": "eq", "variable": "kategoriAsnafSyor", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-berjaya-miskin-path", "output": "Berjaya Miskin", "conditions": [ { "id": "condition-3", "value": "approved", "operator": "eq", "variable": "applicationStatus", "valueType": "string", "logicalOperator": "and" }, { "id": "condition-4", "value": "Miskin", "operator": "eq", "variable": "kategoriAsnafSyor", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-berjaya-non-fm-path", "output": "Berjaya Non-FM", "conditions": [ { "id": "condition-5", "value": "approved", "operator": "eq", "variable": "applicationStatus", "valueType": "string", "logicalOperator": "and" }, { "id": "condition-6", "value": "Non-FM", "operator": "eq", "variable": "kategoriAsnafSyor", "valueType": "string", "logicalOperator": "and" } ] }, { "id": "condition-group-gagal-path", "output": "Gagal", "conditions": [ { "id": "condition-7", "value": "rejected", "operator": "eq", "variable": "applicationStatus", "valueType": "string", "logicalOperator": "and" } ] } ], "borderColor": "#6b7280", "defaultPath": "notification-1753200000002", "description": "Check application status and asnaf category for routing", "gatewayType": "exclusive", "backgroundColor": "#f9fafb" }, "type": "gateway", "label": "Status", "position": { "x": 1470, "y": 615 } }, { "id": "form-pengesahan", "data": { "label": "BF-NAS-PRF-AS-QS-05 Pengesahan", "formId": 8, "formName": "Borang Pengesahan", "formUuid": "8e07fc8f-a160-478a-85fd-fa3364401549", "description": "Form untuk pengesahan dokumen dan maklumat pemohon", "assignedRoles": ["verifier", "admin"], "assignedUsers": [], "inputMappings": [ { "formField": "nama_pemohon", "processVariable": "applicantName" }, { "formField": "no_rujukan", "processVariable": "applicationId" }, { "formField": "kategori_asnaf", "processVariable": "kategoriAsnaf" }, { "formField": "dokumen_berkaitan", "processVariable": "dokumenBerkaitan" }, { "formField": "urgency_level", "processVariable": "urgencyLevel" } ], "assignmentType": "role", "outputMappings": [ { "formField": "status_pengesahan", "processVariable": "pengesahanStatus" }, { "formField": "catatan_pengesahan", "processVariable": "catatanPengesahan" }, { "formField": "dokumen_tambahan_diperlukan", "processVariable": "dokumenTambahanDiperlukan" }, { "formField": "jumlah_bantuan_dicadangkan", "processVariable": "jumlahBantuanDicadangkan" }, { "formField": "jenis_bantuan", "processVariable": "jenisBantuan" }, { "formField": "verified_by", "processVariable": "verifiedBy" }, { "formField": "verification_date", "processVariable": "verificationDate" } ], "fieldConditions": [], "assignmentVariable": "", "assignmentVariableType": "user_id" }, "type": "form", "label": "BF-NAS-PRF-AS-QS-05 Pengesahan", "position": { "x": 2505, "y": 705 } }, { "id": "api-pengesahan-submit", "data": { "label": "Submit Pengesahan API", "apiUrl": "https://api.bantuan.gov.my/v1/verification/submit", "headers": "{ \"Content-Type\": \"application/json\", \"Authorization\": \"Bearer {apiToken}\" }", "apiMethod": "POST", "description": "Submit verification results to central system", "requestBody": "{\n \"applicationId\": \"{applicationId}\",\n \"verificationStatus\": \"{pengesahanStatus}\",\n \"verificationNotes\": \"{catatanPengesahan}\",\n \"additionalDocumentsRequired\": \"{dokumenTambahanDiperlukan}\",\n \"recommendedAmount\": \"{jumlahBantuanDicadangkan}\",\n \"assistanceType\": \"{jenisBantuan}\",\n \"verifiedBy\": \"{verifiedBy}\",\n \"verificationDate\": \"{verificationDate}\",\n \"applicantCategory\": \"{kategoriAsnaf}\",\n \"urgencyLevel\": \"{urgencyLevel}\"\n}", "errorVariable": "pengesahanApiError", "outputVariable": "pengesahanApiResponse", "continueOnError": false }, "type": "api", "label": "Submit Pengesahan API", "position": { "x": 2175, "y": 720 } }, { "id": "script-process-pengesahan", "data": { "label": "Process Pengesahan Response", "scriptCode": "// Process the pengesahan (verification) response\nconst apiData = processVariables.pengesahanApiResponse;\n\nif (apiData && apiData.status === 'success') {\n // Update application status based on verification\n switch (processVariables.pengesahanStatus) {\n case 'lulus':\n processVariables.applicationStatus = 'approved';\n processVariables.statusMessage = 'Permohonan telah diluluskan';\n processVariables.nextAction = 'payment_processing';\n break;\n case 'ditolak':\n processVariables.applicationStatus = 'rejected';\n processVariables.statusMessage = 'Permohonan ditolak: ' + processVariables.catatanPengesahan;\n processVariables.nextAction = 'send_rejection_notice';\n break;\n case 'dokumen_tambahan':\n processVariables.applicationStatus = 'pending_documents';\n processVariables.statusMessage = 'Dokumen tambahan diperlukan';\n processVariables.nextAction = 'request_additional_documents';\n break;\n case 'semakan_lanjut':\n processVariables.applicationStatus = 'under_review';\n processVariables.statusMessage = 'Permohonan dalam semakan lanjut';\n processVariables.nextAction = 'further_review';\n break;\n default:\n processVariables.applicationStatus = 'pending';\n processVariables.statusMessage = 'Status tidak diketahui';\n processVariables.nextAction = 'manual_review';\n }\n \n // Set verification completion flag\n processVariables.verificationCompleted = true;\n processVariables.verificationTimestamp = new Date().toISOString();\n \n // Calculate processing time\n if (processVariables.submissionDate) {\n const submitTime = new Date(processVariables.submissionDate);\n const verifyTime = new Date();\n const processingHours = Math.round((verifyTime - submitTime) / (1000 * 60 * 60));\n processVariables.processingTimeHours = processingHours;\n }\n \n // Set notification flags based on status\n processVariables.sendApprovalNotification = processVariables.applicationStatus === 'approved';\n processVariables.sendRejectionNotification = processVariables.applicationStatus === 'rejected';\n processVariables.sendPendingNotification = processVariables.applicationStatus.includes('pending');\n \n // Set payment processing flag for approved applications\n if (processVariables.applicationStatus === 'approved') {\n processVariables.paymentReady = true;\n processVariables.paymentAmount = processVariables.jumlahBantuanDicadangkan || 0;\n processVariables.paymentMethod = processVariables.sebabTunai === 'ya' ? 'cash' : 'bank_transfer';\n }\n \n console.log('Pengesahan processed successfully:', {\n applicationStatus: processVariables.applicationStatus,\n statusMessage: processVariables.statusMessage,\n nextAction: processVariables.nextAction,\n verificationCompleted: processVariables.verificationCompleted,\n paymentReady: processVariables.paymentReady\n });\n} else {\n // Handle API error\n processVariables.applicationStatus = 'verification_failed';\n processVariables.statusMessage = 'Ralat semasa pengesahan';\n processVariables.verificationCompleted = false;\n processVariables.pengesahanError = apiData ? apiData.message : 'Unknown API error';\n \n console.error('Pengesahan API failed:', processVariables.pengesahanError);\n}", "description": "Process verification results and determine next steps", "errorVariable": "pengesahanScriptError", "inputVariables": [ "pengesahanApiResponse", "pengesahanStatus", "catatanPengesahan", "dokumenTambahanDiperlukan", "jumlahBantuanDicadangkan", "jenisBantuan", "verifiedBy", "verificationDate", "submissionDate", "sebabTunai" ], "scriptLanguage": "javascript", "continueOnError": false, "outputVariables": [ { "name": "applicationStatus", "type": "string", "description": "Final application status after verification" }, { "name": "statusMessage", "type": "string", "description": "Human-readable status message" }, { "name": "nextAction", "type": "string", "description": "Next action to be taken" }, { "name": "verificationCompleted", "type": "boolean", "description": "Whether verification process is completed" }, { "name": "verificationTimestamp", "type": "string", "description": "Timestamp when verification was completed" }, { "name": "processingTimeHours", "type": "number", "description": "Total processing time in hours" }, { "name": "sendApprovalNotification", "type": "boolean", "description": "Whether to send approval notification" }, { "name": "sendRejectionNotification", "type": "boolean", "description": "Whether to send rejection notification" }, { "name": "sendPendingNotification", "type": "boolean", "description": "Whether to send pending status notification" }, { "name": "paymentReady", "type": "boolean", "description": "Whether payment processing is ready" }, { "name": "paymentAmount", "type": "number", "description": "Amount approved for payment" }, { "name": "paymentMethod", "type": "string", "description": "Payment method (cash/bank_transfer)" } ] }, "type": "script", "label": "Process Pengesahan Response", "position": { "x": 2175, "y": 540 } }, { "id": "notification-1753200000002", "data": { "label": "BF-NAS-PRF-AS-QS-06 Terima Notifikasi", "shape": "rectangle", "message": "Assalamualaikum {applicantName},\n\nStatus permohonan bantuan anda telah dikemaskini.\n\nNo Rujukan: {applicationId}\nStatus Terkini: {statusMessage}\nTarikh Kemaskini: {verificationTimestamp}\nDiluluskan oleh: {verifiedBy}\n\n{conditionalMessage}\n\nUntuk maklumat lanjut, sila hubungi pejabat kami.\n\nTerima kasih.", "subject": "Kemaskini Status Permohonan - {applicationId}", "priority": "high", "template": "status_update", "textColor": "#0284c7", "variables": [ "applicantName", "applicationId", "statusMessage", "verificationTimestamp", "verifiedBy", "conditionalMessage" ], "recipients": [{ "type": "variable", "value": "applicantEmail" }], "attachments": [], "borderColor": "#0ea5e9", "description": "Send status update notification to applicant", "backgroundColor": "#f0f9ff", "sendImmediately": true, "notificationType": "email", "conditionalSending": { "conditions": [ { "value": true, "operator": "eq", "variable": "verificationCompleted", "valueType": "boolean" } ] } }, "type": "notification", "label": "Terima Notifikasi", "position": { "x": 3195, "y": 615 } }, { "id": "swimlane-horizontal-1752207659712", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "isShape": true, "shapeType": "swimlane-horizontal", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "swimlane-horizontal", "label": "", "position": { "x": 2940, "y": -570 } }, { "id": "text-annotation-1752207727571", "data": { "label": "", "shape": "rectangle", "width": 200, "height": 80, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Terima Notifikasi", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-QS-06", "position": { "x": 3360, "y": -540 } }, { "id": "text-annotation-1752207881502", "data": { "label": "BF-NAS-PRF-AS-QS-06", "shape": "rectangle", "width": 200, "height": 80, "zIndex": 1, "isShape": true, "shapeType": "text-annotation", "textColor": "#92400e", "borderColor": "#fbbf24", "description": "Terima Notifikasi", "backgroundColor": "#fffbeb" }, "type": "text-annotation", "label": "BF-NAS-PRF-AS-QS-06", "position": { "x": 3375, "y": 525 } }, { "id": "swimlane-horizontal-1752207945135", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "zIndex": 0, "isShape": true, "shapeType": "swimlane-horizontal", "textColor": "#374151", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "swimlane-horizontal", "label": "", "position": { "x": 2100, "y": 495 } }, { "id": "swimlane-horizontal-1752208028711", "data": { "label": "", "shape": "rectangle", "width": 650, "height": 400, "isShape": true, "shapeType": "swimlane-horizontal", "textColor": "#475569", "borderColor": "#16a34a", "description": "", "backgroundColor": "#e8f5e9" }, "type": "swimlane-horizontal", "label": "", "position": { "x": 2955, "y": 495 } } ], "viewport": { "x": -424.4299384069254, "y": 160.3515779089071, "zoom": 0.5618446897868647 } }