
Timer Start: Number of Organizations
This item periodically starts cases with the number of organizations. In each organization type data item of each case, each organization will be set.
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)
- [Process Manager] authorization is required
- Open the start page from the URL:
See Also
- R2170: Limitation on the Number of Running Cases
- M217: Setting a Time and Date to Auto-Start a Case
- Starting a Case Every Monday Morning
- Using Timers to Auto-start Multiple Cases
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
- num_of_qgroups.xml (C) Questetra, Inc. (MIT License)
/**
* @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
};
});
};