Timer Start: Number of Organizations

Auto Step icon
Basic Configs
Step Name
Note
Configs for this Auto Step
conf_idData
C1: Organization type data item *
conf_BaseQgroup
C2: Base Organization *
conf_IncludeBase
C3: Include the Base Organization
conf_Range
C4: Organizations to be included besides the Base Organization *

Notes

  • You can set multiple schedules on a Timer
  • The number of Cases that can be started simultaneously is limited to 100
  • You can start the timer immediately and start the case as defined in the app
    • Open the start page from the URL:
      • https://{YOUR_DOMAIN}/OR/ProcessModel/{APP_ID}/view (the “m” in the app ID is not required)
    • [Case Manager] authorization is required

See also

Script (click to open)
  • An XML file that contains the code below is available to download
    • num_of_qgroups.xml (C) Questetra, Inc. (MIT License)
      • Just use it for a reference for the codes
      • This file cannot be imported into a Workflow App as an Add-on

/**
 * @param {Number} limit 組織数の上限
 * @returns {Array} qgroups 組織一覧
 */
const list = (limit) => {
    const baseQgroup = configs.getObject('conf_BaseQgroup');
    const includeBase = configs.getObject('conf_IncludeBase');
    const range = configs.get('conf_Range');

    const qgroups = [];
    if (includeBase) {
        qgroups.push(baseQgroup);
    }
    switch (range) {
        case 'none':
            if (!includeBase) { // 対象となる組織が存在し得ない
                throw new Error('No target organizations selected.');
            }
            break;
        case 'children':
            qgroups.push(...qgroupDao.findChildQgroups(baseQgroup));
            break;
        case 'descendants':
            qgroups.push(...qgroupDao.findDescendantQgroups(baseQgroup));
            break;
    }
    if (qgroups.length > limit) {
        throw new Error(`The number of qgroups ${qgroups.length} exceeds the limit ${limit}.`);
    }
    return qgroups.map(qgroup => {
        return {
            id: qgroup
        };
    });
};

Discover more from Questetra Support

Subscribe now to keep reading and get access to the full archive.

Continue reading