{"action":"created","issue":{"url":"https://api.github.com/repos/e-government-ua/i/issues/1419","repository_url":"https://api.github.com/repos/e-government-ua/i","labels_url":"https://api.github.com/repos/e-government-ua/i/issues/1419/labels{/name}","comments_url":"https://api.github.com/repos/e-government-ua/i/issues/1419/comments","events_url":"https://api.github.com/repos/e-government-ua/i/issues/1419/events","html_url":"https://github.com/e-government-ua/i/issues/1419","id":185930182,"number":1419,"title":"Организовать переливку закрытых процессов в аналитическую базу","user":{"login":"OlgaTurenko","id":10909557,"avatar_url":"https://avatars.githubusercontent.com/u/10909557?v=3","gravatar_id":"","url":"https://api.github.com/users/OlgaTurenko","html_url":"https://github.com/OlgaTurenko","followers_url":"https://api.github.com/users/OlgaTurenko/followers","following_url":"https://api.github.com/users/OlgaTurenko/following{/other_user}","gists_url":"https://api.github.com/users/OlgaTurenko/gists{/gist_id}","starred_url":"https://api.github.com/users/OlgaTurenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlgaTurenko/subscriptions","organizations_url":"https://api.github.com/users/OlgaTurenko/orgs","repos_url":"https://api.github.com/users/OlgaTurenko/repos","events_url":"https://api.github.com/users/OlgaTurenko/events{/privacy}","received_events_url":"https://api.github.com/users/OlgaTurenko/received_events","type":"User","site_admin":false},"labels":[{"id":239360890,"url":"https://api.github.com/repos/e-government-ua/i/labels/active","name":"active","color":"660033","default":false},{"id":269344728,"url":"https://api.github.com/repos/e-government-ua/i/labels/_wf-base","name":"_wf-base","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"dimochak","id":11542154,"avatar_url":"https://avatars.githubusercontent.com/u/11542154?v=3","gravatar_id":"","url":"https://api.github.com/users/dimochak","html_url":"https://github.com/dimochak","followers_url":"https://api.github.com/users/dimochak/followers","following_url":"https://api.github.com/users/dimochak/following{/other_user}","gists_url":"https://api.github.com/users/dimochak/gists{/gist_id}","starred_url":"https://api.github.com/users/dimochak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimochak/subscriptions","organizations_url":"https://api.github.com/users/dimochak/orgs","repos_url":"https://api.github.com/users/dimochak/repos","events_url":"https://api.github.com/users/dimochak/events{/privacy}","received_events_url":"https://api.github.com/users/dimochak/received_events","type":"User","site_admin":false},"assignees":[{"login":"dimochak","id":11542154,"avatar_url":"https://avatars.githubusercontent.com/u/11542154?v=3","gravatar_id":"","url":"https://api.github.com/users/dimochak","html_url":"https://github.com/dimochak","followers_url":"https://api.github.com/users/dimochak/followers","following_url":"https://api.github.com/users/dimochak/following{/other_user}","gists_url":"https://api.github.com/users/dimochak/gists{/gist_id}","starred_url":"https://api.github.com/users/dimochak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimochak/subscriptions","organizations_url":"https://api.github.com/users/dimochak/orgs","repos_url":"https://api.github.com/users/dimochak/repos","events_url":"https://api.github.com/users/dimochak/events{/privacy}","received_events_url":"https://api.github.com/users/dimochak/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/e-government-ua/i/milestones/5","html_url":"https://github.com/e-government-ua/i/milestone/5","labels_url":"https://api.github.com/repos/e-government-ua/i/milestones/5/labels","id":1063352,"number":5,"title":"BackEnd_Java","description":"Разработка кастомных общих API/REST, которые вначале позволят реализовывать  нужные нам сервисы по авторизации(и не только), а потом станут общей-единой точкой входа, включающую текущие REST Activiti","creator":{"login":"bvv4ik","id":4208821,"avatar_url":"https://avatars.githubusercontent.com/u/4208821?v=3","gravatar_id":"","url":"https://api.github.com/users/bvv4ik","html_url":"https://github.com/bvv4ik","followers_url":"https://api.github.com/users/bvv4ik/followers","following_url":"https://api.github.com/users/bvv4ik/following{/other_user}","gists_url":"https://api.github.com/users/bvv4ik/gists{/gist_id}","starred_url":"https://api.github.com/users/bvv4ik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvv4ik/subscriptions","organizations_url":"https://api.github.com/users/bvv4ik/orgs","repos_url":"https://api.github.com/users/bvv4ik/repos","events_url":"https://api.github.com/users/bvv4ik/events{/privacy}","received_events_url":"https://api.github.com/users/bvv4ik/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":368,"state":"open","created_at":"2015-04-11T19:27:45Z","updated_at":"2016-12-19T14:29:20Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-10-28T13:59:43Z","updated_at":"2016-12-23T17:56:34Z","closed_at":null,"body":"Организовать переливку закрытых процессов в аналитическую базу.\r\n\r\n1) Написать сервис (класс с анатацией @Service) в котором на входе диапазон дат  (dateAt, dateTo), тип даты (старт, финиш) и поле с ид бизнес-процесса sID_Process_Def. По заданным фильтрам делаем выборку ЗАКРЫТЫХ процессов из таблицы хисториПроцес (historyService). Далее идем по каждому процессу и создаем объект org.igov.analytic.model.process.Process (архивный процес), который вдальнейшем будет сохранен в аналитическую бд.\r\n\r\nПосле создания Process  и заполения его всеми данными сохраняем его в аналитическую бд.\r\nПосле успешного сохранения удаляем процес из региональной базы.\r\n\r\nСхема заполнения процесса архивного (первый - объект в аналитической базе, второй - данные активити):\r\n\r\nProcess - процесс активити act_hi_procinst. на один процесс одна запись.\r\nCustom_Process_Activiti - все поля из act_hi_procinst, которые не вошли в сущность Process \r\nSourceDB - источник. всегда = 2;iGov\r\nProcessTask - юзертаска в активити act_hi_taskinst. столько записей, сколько у процесса было \r\nотработанных юзертасок\r\nCustom_ProccessTask_Activiti - все поля из act_hi_taskinst, которые не вошли в ProcessTask .\r\nAttributeName - список всех полей формы активити. справочник. логика заполнения: получили поле юзертаски, берем его ид и название (из незакрытого процесса, так как в закрытом его нет) и смотрим нет ли такого сочетания нейм+сИД в справочнике. Есть - не нужно добавлять, нет - добавляем в справочник. Если нет открытого процессапроцесса по такому бизнеспроцессу с такой юзертаской, то считаем, что нейм равен пустой строке.\r\nAttributeType - сюда пишем тип атрибута. Типы наши и активити соответствуют. Только дополнение наш стрингШот - это их стринга до 255 символов, если больше - пишем в стрингЛонг.\r\nAttribute (и все таблички хранящие значения атрибута) - это переменные формы юзертаски или стартовой формы. (act_hi_varinst). Тоесть одна запись из таблички активити порождает одну запись в атрибуты. Причем если переменная со стартовой формы - то крепим атрибут к Proccess, если с юзертаски - то крепим к ProccessTask.\r\nАттачи крепим к атрибутам с типом файл, и сохраняем в монгу аналитического сервиса (сохранение в монгу не доделано для аналитического сервера. нужно еще разобраться с этим моментом).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/e-government-ua/i/issues/comments/269024916","html_url":"https://github.com/e-government-ua/i/issues/1419#issuecomment-269024916","issue_url":"https://api.github.com/repos/e-government-ua/i/issues/1419","id":269024916,"user":{"login":"OlgaTurenko","id":10909557,"avatar_url":"https://avatars.githubusercontent.com/u/10909557?v=3","gravatar_id":"","url":"https://api.github.com/users/OlgaTurenko","html_url":"https://github.com/OlgaTurenko","followers_url":"https://api.github.com/users/OlgaTurenko/followers","following_url":"https://api.github.com/users/OlgaTurenko/following{/other_user}","gists_url":"https://api.github.com/users/OlgaTurenko/gists{/gist_id}","starred_url":"https://api.github.com/users/OlgaTurenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlgaTurenko/subscriptions","organizations_url":"https://api.github.com/users/OlgaTurenko/orgs","repos_url":"https://api.github.com/users/OlgaTurenko/repos","events_url":"https://api.github.com/users/OlgaTurenko/events{/privacy}","received_events_url":"https://api.github.com/users/OlgaTurenko/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T17:56:34Z","updated_at":"2016-12-23T17:56:34Z","body":"Создать сущность Custom_Process_Activiti "}}
{"actor":{"display_login":"OlgaTurenko"}}