Open jinyoung opened 5 years ago
추가적으로, 설문지가 도달된 결과물을 parsing 하여, 각 field 의 값을 bpm 의 프로세스 변수 및, 매핑으로 연결된 값들에 전송.
이거 보고 힌트 얻음 https://www.44bits.io/ko/post/google-app-script-external-execution-by-ruby
정독하기 https://developers.google.com/apps-script/api/quickstart/target-script
아래 링크를 통해 Google 에 OAuth Developer Verification Update Form
인증을 받아야 함.
https://support.google.com/code/contact/oauth_app_update
폼 작성 후 submit 하면 2~3일 걸린다고 나옴....
Property | Type | Description |
---|---|---|
LEFT | Enum | Align the image to the left side of the form. |
CENTER | Enum | Align the image to the center of the form. |
RIGHT | Enum | Align the image to the right side of the form. |
CHECKBOX | Enum | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
---|---|---|
CHECKBOX_GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |
DATE | Enum | A question item that allows the respondent to indicate a date. |
DATETIME | Enum | A question item that allows the respondent to indicate a date and time. |
DURATION | Enum | A question item that allows the respondent to indicate a length of time. |
GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |
IMAGE | Enum | A layout item that displays an image. |
LIST | Enum | A question item that allows the respondent to select one choice from a drop-down list. |
MULTIPLE_CHOICE | Enum | A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
PAGE_BREAK | Enum | A layout item that marks the start of a page. |
PARAGRAPH_TEXT | Enum | A question item that allows the respondent to enter a block of text. |
SCALE | Enum | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
SECTION_HEADER | Enum | A layout item that visually indicates the start of a section. |
TEXT | Enum | A question item that allows the respondent to enter a single line of text. |
TIME | Enum | A question item that allows the respondent to indicate a time of day. |
VIDEO | Enum | A layout item that displays a YouTube video. |
Property | Type | Description |
---|---|---|
SPREADSHEET | Enum | A Google Sheets spreadsheet as a destination for form responses. |
Property | Type | Description |
---|---|---|
CORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered correctly. Correct feedback can only be attached to a question type that supports autograding (e.g. radio, checkbox, select) |
INCORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered incorrectly. Incorrect feedback can only be attached to a question type that supports autograding (e.g. radio, checkbox, select) |
GENERAL | Enum | Feedback that is automatically displayed to respondents when they submit their response. General feedback can only be attached to question types that do not support auto-grading, but are gradeable (ie everything but grid) |
Property | Type | Description |
---|---|---|
CONTINUE | Enum | Continue to the next page of the form after completing the current page. |
GO_TO_PAGE | Enum | Jump to a specified page of the form after completing the current page. |
RESTART | Enum | Restart the form from the beginning, without clearing answers entered so far, after completing the current page. |
SUBMIT | Enum | Submit the form response after completing the current page. |
https://developers.google.com/identity/protocols/OAuth2WebServer
access_token | The token that your application sends to authorize a Google API request. refresh_token | A token that you can use to obtain a new access token. Refresh tokens are valid until the user revokes access. Again, this field is only present in this response if you set theaccess_type parameter to offline in the initial request to Google's authorization server. expires_in | The remaining lifetime of the access token in seconds. token_type | The type of token returned. At this time, this field's value is always set to Bearer.
{
"access_token":"1/fFAGRNJru1FTz70BzhT3Zg",
"expires_in":3920,
"token_type":"Bearer",
"refresh_token":"1/xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI"
}
토큰 생성 요청시 "access_type" 을 "offline" 으로 주면 refresh_token 을 받급 받을 수 있게 된다.
https://github.com/TheOpenCloudEngine/uEngine5-base/blob/master/process-service/src/main/java/org/uengine/five/overriding/JPAWorkList.java 참고.
혹은, Pub/Sub 개념으로, task 가 발생시 workitem service 가 task 발생 이벤트를 듣고서, email 내, workitem handler url 혹은 google form 을 발송한다.
1.1. Auto-generated workitem 인 경우 - 임시 workitem 처리용 token 발행 및 validation 으로 열어줌.
1.2. Google forms / sheet / docs 를 이용한 경우는: google login 을 유도 --> SSO 창이 열려서 열 수 있으면, 열리는거고, 아니면 못열지... ==> 아래에 풀이
Google Form 사용 필요 API
Step0. 폼 발행할때, taskId 를 폼의 히든값으로 부여하고, 우리쪽에서도, 발행한 폼 아이디를 워크아이템 필드에 가지고 있으면 좋음.
Step1. 모델러에서, 휴먼액티비티에 Google Sheep api 로 설문지 목록을 선택함.
Step2. 모델러 저장시, 다음과 같은 작업을 Google app script api 로 실행하여 설문지를 업데이트함.
업무 처리자가 Google 로 로그인 한 놈이 아니면?