Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
Thai |
---|
เริ่มต้นกับ UiPath |
Info |
---|
Note: This tutorial is for the latest UiPath Studio 20.10 Stable Release, which provides a much simplified sign in and first run experience compared to previous releases. |
...
Let’s sign up for an account at https://www.uipath.com/platform-trial. There is a Community plan to get started for free, so we’ll Choose Community to register.
Thai |
---|
ลงทะเบียนบัญชีที่ https://www.uipath.com/platform-trial มีแผนชุมชนในการเริ่มต้นฟรีเราจึงเลือกชุมชนเพื่อลงทะเบียน |
Sign up using a social account or an email, and upon registration you will be taken to a dashboard at https://platform.uipath.com.
Thai |
---|
ลงทะเบียนโดยใช้บัญชีโซเชียลหรืออีเมลและเมื่อลงทะเบียนคุณจะถูกนำไปที่แดชบอร์ดที่ https://platform.uipath.com |
A service represents a deployment in the company. A default service is already created e.g. DemoDefault.
...
Thai |
---|
บริการแสดงถึงการปรับใช้ใน บริษัท บริการเริ่มต้นถูกสร้างขึ้นแล้วเช่น DemoDefault |
Select the service name to open the UiPath Orchestrator web application.
Thai |
---|
เลือกชื่อบริการเพื่อเปิดเว็บแอปพลิเคชัน UiPath Orchestrator |
...
Thai |
---|
ขั้นตอนที่ 2: ติดตั้ง UiPath Studioและ UiPath Robot |
Download the UiPath Studio installer (UiPathStudioSetup.exe) from the Resource Center, and install it on the target computer. More information on UiPath Studio is available at the UiPath Studio Guide.
Thai |
---|
ดาวน์โหลดตัวติดตั้ง UiPath Studio (UiPathStudioSetup.exe) จาก Resource Center และติดตั้งบนคอมพิวเตอร์เป้าหมาย ข้อมูลเพิ่มเติมเกี่ยวกับ UiPath Studio สามารถดูได้ที่ UiPath Studio Guide |
After installing UiPathStudioSetup.exe, start UiPath Studio from the Windows Start menu and activate it. You can start free by activating the Community Editionlogin using the UiPath account created previously. Choose a profile to use, e.g. UiPath Studio.
Thai |
---|
หลังจากติดตั้ง UiPathStudioSetup.exe ให้เริ่ม UiPath Studio จากเมนู Windows Start และเปิดใช้งาน คุณสามารถเริ่มต้นได้ฟรีโดยเปิดใช้งาน Community Edition |
...
Thai |
---|
ขั้นตอนที่ 3: เรียกใช้ UiPathRobot และรับชื่อเครื่องAssistant |
In the Windows Start menu, search for UiPath RobotAssistant and start it.
Thai |
---|
ในเมนู Windows Start ให้ค้นหา UiPath Robot และเริ่มต้น |
Click on the Gear icon to open the Orchestrator Settings window, and copy the Machine Name.
Thai |
---|
คลิกที่ไอคอนเกียร์เพื่อเปิดหน้าต่างการตั้งค่า Orchestrator และคัดลอกชื่อเครื่อง |
Thai |
---|
ขั้นตอนที่ 4: รับรหัสเครื่อง |
Back in the UiPath Orchestrator, create a new Machine under the Machines menu.
Thai |
---|
ย้อนกลับไปใน UiPath Orchestrator สร้างเครื่องใหม่ภายใต้เมนู Machines |
Info | ||
---|---|---|
IMPORTANT: Make sure that the name matches the Machine Name shown in the UiPath Orchestrator Settings earlier.
|
...
Choose an image, give the robot a name e.g. DemoRobot and click on Get Started to create the robot.
Once the robot is created, it will automatically connect and register itself to the UiPath Orchestrator.
In the UiPath Orchestrator, browse to Tenant > Robots and you should see the robot created in the listing.
Next, we will create an Unattended Robot that does not require human supervision to execute jobs. In the UiPath Orchestrator, browse to Tenant > Users and select Edit in the menu for your user account.
Click on Unattended Robot, enable the “Automatically create an unattended robot for this user” switch, fill in the Windows user credentials and Update.
Next, let’s create an automation process and publish it. Follow the Creating Your First Automation Project tutorial in the UiPath documentation. In that page, there is also a ZIP file containing the completed sample project that you can download.
Once you have completed the project, click on the Publish button in the top toolbar.
Fill in the package properties (you can leave the default values) and click on Publish.
Once the project has been published, you will see it in the UiPath Assistant.
In the UiPath Orchestrator, browse to My Workspace > Automations and you will see the process under listed under Processes.
Now that the robot is published, it’s time to start a job to test it. In the UiPath Orchestrator click on the Play icon on the right of the process in the Processes list. Click on the Start button.
In the UiPath Assistant, the robot will be installed and executed.
In the UiPath Orchestrator, you can monitor the jobs in the Jobs tab under My Workspace > Automations.
There are a number of steps required to retrieve some required information for integration to start a job using the UiPath Orchestrator API. You can use any API testing tool (e.g. Postman), and the example below uses the linux command line using the curl tool.
Browse to https://cloud.uipath.com, select Admin, select the Tenant, and click on the API Access icon.
Copy the Client ID, Account Logical Name, Tenant Logical Name and User Key values to be used in API calls later.
Execute the following curl POST request:
Code Block |
---|
export ACCOUNT_NAME=yourAccountName # the Account Logical Name obtained above
export SERVICE_NAME=yourServiceName # the Tenant Logical Name obtained above
export USER_KEY=yourUserKey # the User Key obtained above
export CLIENT_ID=yourClientID # the Client ID obtained above
# get access token
curl -X POST "https://account.uipath.com/oauth/token" \
-H "Content-Type: application/json" \
--data-raw "{
\"grant_type\": \"refresh_token\",
\"client_id\": \"$CLIENT_ID\",
\"refresh_token\": \"$USER_KEY\"
}" |
Copy the values for access_token from the response.
Code Block |
---|
{
"access_token": "eyJ0eX...",
"id_token": "eyJ0eX...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
} |
Execute the following curl GET request:
Code Block |
---|
export ACCESS_TOKEN=yourAccessToken # set the access token obtained above
export ACCOUNT_NAME=yourAccountName # the Account Logical Name
export SERVICE_NAME=yourServiceName # the Tenant Logical Name
export PROCESS_NAME=First.automation.project # name of your desired process
# get process release key
curl -X GET "https://cloud.uipath.com/$ACCOUNT_NAME/$SERVICE_NAME/orchestrator_/odata/Releases?$filter=ProcessKey%20eq%20%27$PROCESS_NAME%27" \
-H "accept: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" |
Copy the value for Key from the response as the Process Release Key, and the OrganizationUnitId as the Organization Unit ID (Folder ID):
Code Block |
---|
{
"@odata.context": "https://cloud.uipath.com/jogetgdunlhs/DemoDefault/orchestrator_/odata/$metadata#Releases",
"@odata.count": 1,
"value": [
{
"Key": "66945223-98b3-4a0a-8b48-0f60dd7d1c2e",
"ProcessKey": "First.automation.project",
"ProcessVersion": "1.0.1",
"IsLatestVersion": false,
"IsProcessDeleted": false,
"Description": "Start with a blank project to design a new task automation",
"Name": "First.automation.project",
"EnvironmentId": null,
"EnvironmentName": "",
"InputArguments": null,
"ProcessType": "Process",
"SupportsMultipleEntryPoints": false,
"RequiresUserInteraction": true,
"AutoUpdate": false,
"FeedId": "1c57a87b-91c4-4310-97b7-986e1d228a26",
"JobPriority": "Normal",
"CreationTime": "2020-10-15T04:28:49.7Z",
"OrganizationUnitId": 123456,
"OrganizationUnitFullyQualifiedName": "user’s workspace",
"Id": 173235,
"Arguments": {
"Input": null,
"Output": null
},
"ProcessSettings": null
}
]
} |
Let’s try making an API call to start a job for the process.
Code Block |
---|
export ACCESS_TOKEN=yourAccessToken # set the access token obtained above
export ACCOUNT_NAME=yourAccountName # the Account Logical Name
export SERVICE_NAME=yourServiceName # the Tenant Logical Name
export PROCESS_RELEASE_KEY=yourProcessReleaseKey # copy from the process release key above
export ORGANIZATION_UNIT_ID=yourOrganizationUnitId # copy from the Organization Unit ID above
# start job
curl -X POST "https://cloud.uipath.com/$ACCOUNT_NAME/$SERVICE_NAME/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs" \
-H "accept: application/json" \
-H "Content-Type: application/json;odata.metadata=minimal;odata.streaming=true" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-UIPATH-OrganizationUnitId: $ORGANIZATION_UNIT_ID" \
-d "{ \"startInfo\": { \"ReleaseKey\": \"$PROCESS_RELEASE_KEY\", \"Strategy\": \"ModernJobsCount\", \"JobsCount\": \"1\", \"RuntimeType\": \"Studio\" }}" |
If successful, the response will be as follows, with the status of the Job shown in the State attribute:
Code Block |
---|
{
"@odata.context": "https://cloud.uipath.com/jogetgdunlhs/DemoDefault/orchestrator_/odata/$metadata#Jobs",
"value": [
{
"Key": "4c8ba95c-fb66-43fa-81bf-8996b4326c09",
"StartTime": null,
"EndTime": null,
"State": "Pending",
"JobPriority": "Normal",
"Source": "Manual",
"SourceType": "Manual",
"BatchExecutionKey": "141042d1-20b7-4271-91bb-07aa08087431",
"Info": null,
"CreationTime": "2020-10-15T13:36:34.497Z",
"StartingScheduleId": null,
"ReleaseName": "First.automation.project",
"Type": "Unattended",
"InputArguments": null,
"OutputArguments": null,
"HostMachineName": null,
"HasMediaRecorded": false,
"PersistenceId": null,
"ResumeVersion": null,
"StopStrategy": null,
"RuntimeType": "Unattended",
"RequiresUserInteraction": true,
"ReleaseVersionId": null,
"EntryPointPath": null,
"OrganizationUnitId": 611841,
"OrganizationUnitFullyQualifiedName": null,
"Reference": "",
"Id": 18614259
}
]
} |
...
View the selected Machine and copy the Machine Key.
Thai |
---|
ดูเครื่องที่เลือกและคัดลอกหมายเลขเครื่อง |
Thai |
---|
ขั้นตอนที่ 5: เชื่อมต่อหุ่นยนต์ UiPath เข้ากับเครื่อง |
In the UiPath Robot, click on the Gear icon to open the Orchestrator Settings window.
Fill in the Orchestrator URL (https://platform.uipath.com for the UiPath Cloud Platform) and the Machine Key copied in the previous step, then click on Connect.
Thai |
---|
ใน UiPath Robot คลิกที่ไอคอนเกียร์เพื่อเปิดหน้าต่างการตั้งค่า Orchestrator กรอก URL ของ Orchestrator (https://platform.uipath.com สำหรับแพลตฟอร์ม UiPath Cloud) และรหัสเครื่องที่คัดลอกในขั้นตอนก่อนหน้าจากนั้นคลิกที่เชื่อมต่อ |
Info | ||
---|---|---|
Once connected, you should see “Status: Robot unavailable” at the bottom of the window. Hover over that message, and you should see the reason “Robot is not available.” This message means that the machine connection is valid, so now it’s time to create a robot. If you see a different reason then there might be an error in your configuration so you will want to double check your settings.
|
Thai |
---|
ขั้นตอนที่ 6: สร้างหุ่นยนต์ |
In the UiPath Orchestrator under the Robots menu, click on the Plus icon on the top right.
Choose “standard robot that works on a single standard machine”.
Assign the robot to the machine created previously.
Set a “Name”, and fill in the actual Windows login for the target machine (where the UiPath Robot is installed) under Domain\Username and Password.
Thai |
---|
ใน UiPath Orchestrator ใต้เมนู Robots คลิกที่ไอคอนเครื่องหมายบวกที่ด้านบนขวา เลือก“ หุ่นยนต์มาตรฐานที่ทำงานกับเครื่องมาตรฐานเดียว” กำหนดหุ่นยนต์ให้กับเครื่องที่สร้างไว้ก่อนหน้านี้ ตั้งค่า“ ชื่อ” และกรอกข้อมูลล็อกอิน Windows จริงสำหรับเครื่องเป้าหมาย (ที่ติดตั้ง UiPath Robot) ภายใต้โดเมน \ ชื่อผู้ใช้และรหัสผ่าน |
Thai |
---|
ขั้นตอนที่ 7: เพิ่มหุ่นยนต์ในสภาพแวดล้อม |
Next, we’ll need to add the created Robot to the Environment. Select the Environments tab at the top of the Robots menu and select the Manage option.
Thai |
---|
ต่อไปเราจะต้องเพิ่มหุ่นยนต์ที่สร้างขึ้นเพื่อสิ่งแวดล้อม เลือกแท็บสภาพแวดล้อมที่ด้านบนของเมนู Robots และเลือกตัวเลือกจัดการ |
Select the previously created robot and click UPDATE.
Thai |
---|
เลือกหุ่นยนต์ที่สร้างขึ้นก่อนหน้านี้และคลิกอัปเดต |
At this point, the robot should be successfully connected to the machine. Check the UiPath Robot Orchestrator Settings and the status should show “Connected, licensed”
Thai |
---|
ณ จุดนี้หุ่นยนต์ควรจะเชื่อมต่อกับเครื่องได้สำเร็จ ตรวจสอบการตั้งค่า UiPath Robot Orchestrator และสถานะควรแสดง“ เชื่อมต่อได้รับอนุญาต” |
Thai |
---|
ขั้นตอนที่ 8: เริ่มงาน |
Now that the robot is deployed, it’s time to start a job to test it.
Under Jobs, click on the Play icon on the top right.
Select the pre-existing Demo Process and the previously robot, then click on Start.
Thai |
---|
ตอนนี้ได้รับการปรับใช้แล้วก็ถึงเวลาที่จะเริ่มงานเพื่อทดสอบ ภายใต้งานให้คลิกที่ไอคอนเล่นที่ด้านบนขวา เลือกกระบวนการสาธิตที่มีอยู่แล้วและหุ่นยนต์ก่อนหน้านี้จากนั้นคลิกที่เริ่ม |
In the UiPath Robot, it will show “Installing package…”. Once the package has been installed, it will show “Job started processing” which means the process has started. In this demo process, a Hello popup dialog will appear.
Thai |
---|
ใน UiPath Robot มันจะแสดง“ การติดตั้งแพ็คเกจ…” เมื่อติดตั้งแพคเกจแล้วมันจะแสดง“ การประมวลผลเริ่มงาน” ซึ่งหมายถึงกระบวนการเริ่ม ในกระบวนการสาธิตนี้กล่องโต้ตอบสวัสดีป๊อปอัพจะปรากฏขึ้น |
The robot has successfully started the job. You can monitor the robots and jobs in the Monitoring menu in the UiPath Orchestrator.
Thai |
---|
หุ่นยนต์เริ่มงานได้สำเร็จ คุณสามารถตรวจสอบหุ่นยนต์และงานในเมนูการตรวจสอบใน UiPath Orchestrator |
Thai |
---|
ขั้นตอนที่ 9: เตรียมความพร้อมสำหรับการรวม UiPath |
In June 2019, UiPath introduced a new mechanism for consuming its Cloud APIs. There are a number of steps required to retrieve some required information for integration:
Thai |
---|
ในเดือนมิถุนายน 2019 UiPath แนะนำกลไกใหม่สำหรับการใช้ Cloud API มีหลายขั้นตอนที่จำเป็นในการดึงข้อมูลที่จำเป็นสำหรับการรวม: |
Thai |
---|
รับการเข้าถึงและโทเค็น ID |
Thai |
---|
สร้าง Code Challenge และ Code Verifier |
In a web browser, visit https://repl.it/languages/nodejs and run the following code:
Thai |
---|
ในเว็บเบราว์เซอร์ไปที่ https://repl.it/languages/nodejs และเรียกใช้รหัสต่อไปนี้: |
Code Block |
---|
function base64URLEncode(str) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
function sha256(buffer) {
return crypto.createHash('sha256').update(buffer).digest();
}
console.log("Generating challenge and Verifier");
var cryptoResult = crypto.randomBytes(32);
var verifier = base64URLEncode(cryptoResult);
var challenge = base64URLEncode(sha256(verifier));
console.log("Code challenge: " + challenge)
console.log("Code verifier: " + verifier); |
Take note of the code challenge and code verifier values in the output e.g.
...
Code Block |
---|
Generating challenge and Verifier
Code challenge: RzYlHiiGzPGgOLaRQJYftZ1mmc3sCbeicZVRftTmC-A
Code verifier: YVMnLczXQgJ9dwzV7MlMWEjGyAia4nXvTZzU4UVrAPE |
Thai |
---|
รับรหัสอนุญาต |
Replace the code challenge into the URL below, and visit the updated URL in a browser.
Thai |
---|
แทนที่ code challenge เป็น URL ด้านล่างและไปที่ URL ที่อัปเดตในเบราว์เซอร์ |
https://account.uipath.com/authorize?response_type=code&nonce=b0f368cbc59c6b99ccc8e9b66a30b4a6&state=47441df4d0f0a89da08d43b6dfdc4be2&code_challenge=[code_challenge]&code_challenge_method=S256&scope=openid+profile+offline_access+email &audience=https%3A%2F%2Forchestrator.cloud.uipath.com&client_id=5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN&redirect_uri=https%3A%2F%2Faccount.uipath.com%2Fmobile
The browser should redirect to:
Thai |
---|
เบราว์เซอร์ควรเปลี่ยนเส้นทางไปที่: |
https://account.uipath.com/mobile?code=[authorization_code]&state=47441df4d0f0a89da08d43b6dfdc4be2
Copy the authorization_code in the URL.
Thai |
---|
คัดลอก author_code ใน URL |
Thai |
---|
รับโทเค็นรีเฟรช |
Using any API testing tool (e.g. Postman), submit a POST request to
https://account.uipath.com/oauth/token with the body below, replacing the values for [authorization_code] and [code_verifier] accordingly.
Thai |
---|
ใช้เครื่องมือทดสอบ API ใด ๆ (เช่น Postman) ส่งคำขอ POST ถึง https://account.uipath.com/oauth/token ด้วยเนื้อหาด้านล่างแทนที่ค่าสำหรับ [authorization_code] และ [code_verifier] ตามลำดับ |
Code Block |
---|
{
"grant_type": "authorization_code",
"code": "[authorization_code]",
"redirect_uri": "https://account.uipath.com/mobile",
"code_verifier": "[code verifier]",
"client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN"
} |
Copy the value of the refresh_token from the response:
Thai |
---|
คัดลอกค่าของ refresh_token จากการตอบกลับ: |
Code Block |
---|
{
"access_token": "eyJ0eX...",
"refresh_token": "CBZcOD6vrP2FQ9qa8fuqDdfoEwnVPuR2Kpz-hitbTAIzG",
"id_token": "eyJ0eX...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
} |
Thai |
---|
รับโทเค็นการเข้าถึงและ ID โดยใช้รีเฟรชโทเค็น |
Using any API testing tool, submit a POST request to
https://account.uipath.com/oauth/token with the body below, replacing the values for [refresh_token] accordingly.
Thai |
---|
ใช้เครื่องมือทดสอบ API ใด ๆ ส่งคำขอ POST ถึง https://account.uipath.com/oauth/token ด้วยเนื้อหาด้านล่างแทนที่ค่าสำหรับ [refresh_token] ตามลำดับ |
Code Block |
---|
{
"grant_type": "refresh_token",
"client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN",
"refresh_token": "[refresh_token]"
} |
Copy the values for access_token and id_token from the response.
Thai |
---|
คัดลอกค่าสำหรับ access_token และ id_token จากการตอบกลับ |
Code Block |
---|
{
"access_token": "eyJ0eX...",
"id_token": "eyJ0eX...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
} |
Thai |
---|
รับบัญชี UiPath บริการและตัวระบุกระบวนการ |
Thai |
---|
รับชื่อตรรกะบัญชี |
Using any API testing tool, submit a GET request to
https://platform.uipath.com/cloudrpa/api/getAccountsForUser with a request header
Thai |
---|
ใช้เครื่องมือทดสอบ API ใด ๆ ส่งคำขอ GET ถึง https://platform.uipath.com/cloudrpa/api/getAccountsForUser พร้อมส่วนหัวคำขอ |
Code Block |
---|
Authorization: Bearer [id_token] |
Copy the value for accountLogicalName from the response:
Thai |
---|
คัดลอกค่าสำหรับ accountLogicalName จากการตอบกลับ: |
Code Block |
---|
{
"userEmail": "demo@domain.com",
"accounts": [
{
"accountName": "Demo",
"accountLogicalName": "Demo"
}
]
} |
Thai |
---|
รับชื่อตรรกะของอินสแตนซ์ของบริการ |
Using any API testing tool, submit a GET request to
https://platform.uipath.com/cloudrpa/api/account/[accountLogicalName]/getAllServiceInstances with a request header
Thai |
---|
ใช้เครื่องมือทดสอบ API ใด ๆ ส่งคำขอ GET ถึง https://platform.uipath.com/cloudrpa/api/account/ ชัดaccountLogicalNameเหมือนกัน /getAllServiceInstance พร้อมส่วนหัวคำขอ |
Code Block |
---|
Authorization: Bearer [id_token] |
Copy the value for serviceInstanceLogicalName from the response:
Thai |
---|
คัดลอกค่าสำหรับ serviceInstanceLogicalName จากการตอบกลับ: |
Code Block |
---|
[
{
"serviceInstanceName": "DemoDefault",
"serviceInstanceLogicalName": "DemoDefaultzous50676",
"serviceType": "ORCHESTRATOR",
"serviceUrl": "https://platform-community.azurewebsites.net"
}
] |
Thai |
---|
รับรหัสการอนุมัติสำหรับกระบวนการที่ต้องการ |
We will now need to retrieve the Release Key, a unique identifier for a desired process. Using any API testing tool, submit a GET request to
https://platform.uipath.com/odata/Releases with request headers
Thai |
---|
ตอนนี้เราจะต้องดึงรหัสรีลีสซึ่งเป็นตัวระบุเฉพาะสำหรับกระบวนการที่ต้องการ ใช้เครื่องมือทดสอบ API ใด ๆ ส่งคำขอ GET ถึง https://platform.uipath.com/odata/Releases กับส่วนหัวคำขอ |
Code Block |
---|
Authorization: Bearer [access_token]
X-UIPATH-TenantName: [serviceInstanceLogicalName] |
Copy the value for Key from the response:
Thai |
---|
คัดลอกค่าสำหรับคีย์จากการตอบกลับ: |
Code Block |
---|
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Releases",
"@odata.count": 1,
"value": [
{
"Key": "b27c7363-459c-4520-bae5-660d4a1d3813",
"ProcessKey": "Demo_Process",
"ProcessVersion": "1.0.21",
"IsLatestVersion": false,
"IsProcessDeleted": false,
"Description": "Demo Process",
"Name": "Demo Process",
"EnvironmentId": 98069,
"EnvironmentName": "Demo Environment",
"InputArguments": null,
"QueueDefinitionId": null,
"QueueDefinitionName": null,
"Id": 120897,
"Arguments": {
"Input": null,
"Output": null
},
"ProcessSettings": null
}
]
} |
Thai |
---|
ทดสอบ Orchestrator API เพื่อเริ่มงาน |
At this point, make sure you have the following critical information at hand:
Thai |
---|
ณ จุดนี้ตรวจสอบให้แน่ใจว่าคุณมีข้อมูลสำคัญต่อไปนี้: |
refresh_token (Refresh Token)
access_token (Access Token)
serviceInstanceLogicalName (Service Instance Logical Name)
Key (Release Key)
Let’s try making an API call to start a job for the process.
Using any API testing tool, submit a POST request to
https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs with 2 request headers
Thai |
---|
ลองทำการเรียก API เพื่อเริ่มงานสำหรับกระบวนการ ใช้เครื่องมือทดสอบ API ใด ๆ ส่งคำขอ POST ถึง https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs พร้อม 2 ส่วนหัวคำขอ |
Code Block |
---|
Authorization: Bearer [access_token]
X-UIPATH-TenantName: [serviceInstanceLogicalName] |
and the body:
Thai |
---|
และร่างกาย: |
Code Block |
---|
{ "startInfo":
{ "ReleaseKey": "[Key]",
"Strategy": "All",
"RobotIds": [ ],
"JobsCount": 0,
"Source": "Manual"
}
} |
If successful, the response will be as follows, with the status of the Job shown in the State attribute:
Thai |
---|
หากประสบความสำเร็จการตอบสนองจะเป็นดังนี้ด้วยสถานะของงานที่แสดงในแอตทริบิวต์ของรัฐ: |
Code Block |
---|
{
"@odata.context": "https://platform.uipath.com/odata/$metadata#Jobs",
"value": [
{
"Key": "e811bd29-26fb-4cc3-af91-7fd6308ca643",
"StartTime": null,
"EndTime": null,
"State": "Pending",
"Source": "Manual",
"SourceType": "Manual",
"BatchExecutionKey": "382e7a96-a5b9-4343-b258-26a80cf87f80",
"Info": null,
"CreationTime": "2019-06-12T08:02:03.2595408Z",
"StartingScheduleId": null,
"ReleaseName": "Demo Process",
"Type": "Unattended",
"InputArguments": null,
"OutputArguments": null,
"HostMachineName": null,
"HasMediaRecorded": false,
"Id": 10169582
}
]
} |
...
Thai |
---|
เนื่องจาก UiPath Orchestrator API เป็น REST API ที่มีข้อมูลในรูปแบบJSONเราจึงสามารถใช้ JogetJSON Toolเพื่อเรียกใช้ API ก่อนที่เราจะเริ่มตรวจสอบให้แน่ใจว่าคุณมีข้อมูล UiPath ที่สำคัญต่อไปนี้อยู่ในมือ (ได้รับจากบทเรียนการเตรียมการสำหรับการรวม UiPath ก่อนหน้านี้): |
Thai |
---|
ขั้นตอนที่ 1 ออกแบบแอพใหม่ |
First, let’s design a new app by clicking on Design New App in the Joget App Center.
Thai |
---|
ขั้นแรกให้ออกแบบแอปใหม่โดยคลิกที่ออกแบบแอปใหม่ใน Joget App Center |
Fill in desired values for the App ID and App Name, and click Save.
Thai |
---|
กรอกค่าที่ต้องการสำหรับ ID แอปและชื่อแอพแล้วคลิกบันทึก |
...
Thai |
---|
ขั้นตอนที่ 2 ออกแบบกระบวนการใหม่ |
Click on the Processes menu, then on the Design Process button to launch the Process Builder.
...
Thai |
---|
เมื่อกระบวนการได้รับการปรับใช้ให้ปิดตัวสร้างกระบวนการ ในหน้ามุมมองกระบวนการให้เลือกแท็บเครื่องมือแผนที่เป็นปลั๊กอิน |
Click on Configure Plugin for the first tool and select JSON Tool, then key in the following configuration:
...
JSON URL | |
Call Type | POST |
POST Method | Custom JSON Payload |
Custom JSON Payload | { "grant_type": "refresh_token", "client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN[clientId]", "refresh_token": "[refresh_tokenuserKey]" } |
Under Store to Workflow Variable, map the variables to store the tokens in the matching workflow variables i.e.
...
access_token | access_token |
id_token | id_token |
Click on Submit to save.
...
Thai |
---|
ขั้นตอนที่ 4 กำหนดค่าเครื่องมือที่สองเพื่อเริ่มงานโดยใช้โทเค็นการเข้าถึง |
Click on Configure Plugin for the second tool and select JSON Tool, then key in the following configuration:
Thai |
---|
คลิกที่ Configure Plugin สำหรับเครื่องมือที่สองและเลือกเครื่องมือ JSON จากนั้นป้อนการกำหนดค่าต่อไปนี้: |
JSON URL | https://platformcloud.uipath.com/[accountlogicalName]/[tenantLogicalName]/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs |
Call Type | POST |
POST Method | Custom JSON Payload |
Custom JSON Payload Payload (Replace [KeyprocessReleaseKey] with the actual Release Key) | { "startInfo": { "ReleaseKey": "[KeyprocessReleaseKey]", "Strategy": "AllModernJobsCount", "RobotIds": [ ], "JobsCount": 01, "SourceRuntimeType": "ManualStudio" } } |
Request Headers (Replace [serviceInstanceLogicalNameorganizationUnitId] with the actual Service Instance Logical NameFolder ID or Organization Unit ID | Authorization: Bearer #variable.access_token# X-UIPATH-TenantNameOrganizationUnitId: [serviceInstanceLogicalNameorganizationUnitId] |
Under Store to Workflow Variable, map the status variable to the State attribute in the response JSON i.e.
Thai |
---|
ใต้ Store to Workflow Variable ให้จับคู่ตัวแปรสถานะกับแอตทริบิวต์ State ในการตอบสนอง JSON เช่น |
status | value[0].State |
That’s it. The Joget process has been configured to invoke the UiPath Orchestrator API to start a job.
Thai |
---|
แค่นั้นแหละ. กระบวนการ Joget ได้รับการกำหนดค่าให้เรียกใช้ UiPath Orchestrator API เพื่อเริ่มงาน |
...
Now, let’s test the process. Click on the Run Process button at the top, then Run Process again in the confirmation dialog.
Thai |
---|
ตอนนี้มาทดสอบกระบวนการกัน คลิกที่ปุ่ม Run Process ที่ด้านบนจากนั้น Run Process อีกครั้งในกล่องโต้ตอบการยืนยัน |
Once the process has started, the 2 tools will execute as configured. To view the results of the process, navigate to Monitor -> Completed Processes.
Select the process instance and you will see the 2 tools executed.
Thai |
---|
เมื่อกระบวนการเริ่มต้นเครื่องมือ 2 ตัวจะทำงานตามที่กำหนดไว้ หากต้องการดูผลลัพธ์ของกระบวนการให้ไปที่การตรวจสอบ -> กระบวนการที่เสร็จสมบูรณ์ เลือกตัวอย่างกระบวนการและคุณจะเห็นเครื่องมือ 2 ตัวดำเนินการ |
Click on each activity to view the values of the workflow variables which obtained the results of the Orchestrator API calls.
Thai |
---|
คลิกที่แต่ละกิจกรรมเพื่อดูค่าของตัวแปรเวิร์กโฟลว์ที่ได้รับผลลัพธ์ของการเรียกใช้ Orchestrator API |
You If you are running Joget on-premise and have access to the system logs, you will be able to see the tool requests and responses in the logs if the debugging option is enabled.
Sample log output:
Thai |
---|
หากคุณใช้งาน Joget ในสถานที่และสามารถเข้าถึงบันทึกของระบบคุณจะสามารถเห็นคำขอเครื่องมือและการตอบสนองหากเปิดใช้งานตัวเลือกการแก้ไขข้อบกพร่อง เอาต์พุตบันทึกตัวอย่าง: |
Code Block |
---|
INFO 1216 JunOct 20192020 0900:2807:3842 org.joget.apps.app.lib.JsonTool - POST : https://account.uipath.com/oauth/token INFO 1216 JunOct 20192020 0900:2807:3842 org.joget.apps.app.lib.JsonTool - Custom JSON Payload : {_ "grant_type": "refresh_token",_ "client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQNclient_id",_ "refresh_token": "CBZcOD6vrP2FQ9qa8fuqDdfoEwnVPuR2Kpz-hitbTAIzGrefresh_token"_}_ INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - https://account.uipath.com/oauth/token returned with status : 200 INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - {"access_token":"eyJ0eX...access_token","id_token":"id_token","scope":"openid profile email offline_access","expires_in":86400,"token_type":"Bearer"} INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - POST : https://platformcloud.uipath.com/yourAccountName/DemoDefault/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - Custom JSON Payload : { "startInfo":_ { "ReleaseKey": "b27c7363-459c-4520-bae5-660d4a1d3813processReleaseKey",_ "Strategy": "AllModernJobsCount",_ "RobotIds": [ ],_ "JobsCount": 01,_ "SourceRuntimeType": "ManualStudio" _ } _}_ INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - Adding request header Authorization : Bearer eyJ0eX...access_token INFO 1216 JunOct 20192020 0900:2807:3943 org.joget.apps.app.lib.JsonTool - Adding request header X-UIPATH-TenantNameOrganizationUnitId : DemoDefaultzous50676organizationUnitId INFO 1216 JunOct 20192020 0900:2807:4044 org.joget.apps.app.lib.JsonTool - https://platformcloud.uipath.com/yourAccountName/DemoDefault/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs returned with status : 201 INFO 1216 JunOct 20192020 0900:2807:4044 org.joget.apps.app.lib.JsonTool - {"@odata.context":"https://platform.uipath.com/odata/$metadata#Jobs","value":[{"Key":"aa667a3e-04f9-4013-a8eb-ce701dac8799","StartTime":null,"EndTime":null,"State":"Pending","Source":"Manual","SourceType":"Manual","BatchExecutionKey":"68fa4d0a-0fcc-4d49-ae0d-b6631a7dfc78","Info":null,"CreationTime":"2019-06-12T09:28:12.9207318Z","StartingScheduleId":null,"ReleaseName":"Demo Process","Type":"Unattended","InputArguments":null,"OutputArguments":null,"HostMachineName":null,"HasMediaRecorded":false,"Id":10173064}]} |
If you are using Joget DX, you can stream the logs directly in the web browser.
Thai |
---|
หากคุณใช้ Joget DX คุณสามารถสตรีมบันทึกได้โดยตรงในเว็บเบราว์เซอร์ |
.JsonTool - {"@odata.context":"https://cloud.uipath.com/yourAccountName/DemoDefault/orchestrator_/odata/$metadata#Jobs","value":[{"Key":"0a53aca6-ad56-40de-bd72-dd757e817a5b","StartTime":null,"EndTime":null,"State":"Pending","JobPriority":"Normal","Source":"Manual","SourceType":"Manual","BatchExecutionKey":"2e1adac4-c4f6-4bb8-b697-c87e33744de9","Info":null,"CreationTime":"2020-10-16T00:07:44.43Z","StartingScheduleId":null,"ReleaseName":"First.automation.project","Type":"Unattended","InputArguments":null,"OutputArguments":null,"HostMachineName":null,"HasMediaRecorded":false,"PersistenceId":null,"ResumeVersion":null,"StopStrategy":null,"RuntimeType":"Development","RequiresUserInteraction":true,"ReleaseVersionId":null,"EntryPointPath":null,"OrganizationUnitId":organizationUnitId,"OrganizationUnitFullyQualifiedName":null,"Reference":"","Id":18675957}]} |
Back at the UiPath Orchestrator and UiPath RobotAssistant, you would also be able to monitor the execution of the job.
Thai |
---|
กลับไปที่ UiPath Orchestrator และ UiPath Robot คุณจะสามารถตรวจสอบการทำงานของงานได้ |
...
Thai |
---|
แอปตัวอย่างที่มีกระบวนการนี้สามารถดาวน์โหลดได้ด้านล่าง: |
Download Download the sample app View file name
1APP_rpa_uipath-
201906121414403- 20201016023843.jwa height 250