Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Irina Oleynik
synergy-components
Commits
bc46ea47
Commit
bc46ea47
authored
Jan 26, 2022
by
Irina Oleynik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
23c4f1f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
interpreter/event.blocking.interpreter.timer
interpreter/event.blocking.interpreter.timer
+46
-0
No files found.
interpreter/event.blocking.interpreter.timer
0 → 100644
View file @
bc46ea47
// этот БП будет запущен при наступлении времени таймера в маршруте
var result = true;
var message = "OK";
// Найти работы с кодом approve
function processesFilter(processes, userID) {
let result = [];
function search(p) {
p.forEach(function(x) {
if (x.code == 'approve' && x.typeID == 'ASSIGNMENT_ITEM' && !x.finished && x.responsibleUserID == userID) {
result.push(x);
// log.info('найдено result', result);
}
if (x.subProcesses.length > 0) search(x.subProcesses);
});
}
search(processes);
return result;
}
try {
let currentFormData = API.getFormData(dataUUID);
let currentUser = API.httpGetMethod("rest/api/person/auth");
// Найти работы для пользователя, от имени которого запускается БП (должна быть параллельная работа для этого пользователя)
let processes = processesFilter(API.getProcesses(documentID), currentUser.userid);
// записать данные на форму завершения
if(processes.length != 0) {
let actionID = processes[0].actionID;
let resultFormWork = API.getFormForResult("service_form_approve", actionID);
let resultFormWorkData = API.getFormData(resultFormWork.dataUUID);
UTILS.setValue(resultFormWorkData, "is_ok", {key: '1', value: 'Да'});
UTILS.setValue(resultFormWorkData, "comment", {value: 'Закрыто по таймеру, т.к. время на подтверждение истекло'});
// завершить работу
API.saveFormData(resultFormWorkData);
API.finishWork(actionID, resultFormWork.file_identifier);
}
} catch (err) {
log.error(err.message);
message = err.message;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment