Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
English

This article is a quick how-to sample exercise for beginners trying to integrate Joget with external

...

applications.

In this exercise, we will show you

...

how to start a process in Joget from an external page. We will also show you

...

how to set a Workflow Variable value along the way which will be used to define one of the participants of the

...

process.

Thai

บทความนี้เป็นแบบฝึกหัดตัวอย่างวิธีด่วนสำหรับผู้เริ่มต้นที่พยายามรวม Joget กับแอปพลิเคชันภายนอก

ในแบบฝึกหัดนี้เราจะแสดงวิธีเริ่มกระบวนการใน Joget จากหน้าภายนอก นอกจากนี้เราจะแสดงวิธีตั้งค่าตัวแปรของเวิร์กโฟลว์ตามวิธีการที่จะใช้ในการกำหนดหนึ่งในผู้เข้าร่วมของกระบวนการเวิร์กโฟลว์

...

We are going to create a simple Workflow Process process as followfollows.

Thai

กำลังเตรียมแอพ Joget


เราจะสร้างกระบวนการทำงานอย่างง่ายดังต่อไปนี้


Image AddedImage Removed
Figure 1: Creating a Workflow App

...

APP_simpleApproval-1-20140211152817.zipjwa

Thai

รูปที่ 1: การสร้างแอปเวิร์กโฟลว์

จด ID นิยามกระบวนการและตรวจสอบให้แน่ใจว่าคุณได้แมปตัวแปรเวิร์กโฟลว์กับหนึ่งในผู้เข้าร่วม หากคุณต้องการคุณสามารถดาวน์โหลดแอพได้โดยคลิกที่ลิงค์ด้านล่าง

APP_simpleApproval-1-20140211152817.zip

...

Code Block
langhtml
titleExternal Page
<html>
	<head>
		<script type="text/javascript" src="http://localhost:8080/jw/js/jquery/jquery-13.5.21.min.js"></script>
		<script type="text/javascript" src="http://localhost:8080/jw/js/json/util.js" ></script>
		<script type="text/javascript" >

		$(document).ready(function(){
			var loginCallback = {
				success : function(response){
					if(response.username != "roleAnonymous"){
						alert("login successfully");
					}else{
						alert("login fail");
					}
				}
			};
			//login
			AssignmentManager.login('http://localhost:8080/jw', 'admin', 'admin', loginCallback);

			$("input[name='startProcessButton']").click( function(){
				//retrieving the values
				var processDefinition = $("input[name='processDefinition']").val()
				var requester = $("input[name='requester']").val()

				//call back for "start a process"
				var callback = {
				  success : function(responsedata){
					//print returned result
					$("#responseDiv").html(response.toSource(data));
				  }
				}

				//start a process
				ConnectionManager.ajaxJsonppost('http://localhost:8080/jw/web/json/workflow/process/start/' + processDefinition, callback, "var_requester=" + requester);

			});

		});
		</script>

	</head>
	<body>
		<fieldset id="startProcess">
			<legend>Start Process:</legend>

			<label for="name">Process Definition:</label>
			<input type="textfield" name="processDefinition" value="simpleApproval:1latest:sample"/>
			<br>
			<label for="name">Requester Username:</label>
			<input type="textfield" name="requester"/>

			<input name="startProcessButton" type="submit" value="Trigger"/>

			<div id="responseDiv"/>
		</fieldset>
	</body>
</html>

Your final path should be something like \Joget-v3DX8-Enterprise\apache-tomcat-68.05.1878\webapps\poc\index.html.

You will need to study the code above where occasional remarks are placed to help you to understand.

Thai

เส้นทางสุดท้ายของคุณควรเป็น \Joget-v3DX8-Enterprise \ apache-tomcat-68.05.18 78\webapps\poc\ index.html

คุณจะต้องศึกษารหัสด้านบนซึ่งมีการใส่คำพูดเป็นครั้งคราวเพื่อช่วยให้คุณเข้าใจ

...

Thai

การดำเนินการและการทดสอบ


จากเบราว์เซอร์ของคุณค้นหาเส้นทางของคุณไปยังหน้า index.html


Image AddedImage Removed
Figure 2: External Page

...

Thai

รูปที่ 2: หน้าภายนอก

รหัสข้อกำหนดกระบวนการได้รับการเติมในการเข้ารหัสก่อนหน้านี้แล้ว จำไว้ว่าแทนที่ hash (#) ด้วยเครื่องหมายโคลอน (:) ใน id ป้อนชื่อผู้ใช้และกด Trigger


Image AddedImage Removed
Figure 3: Starting a Process Instance

...

Thai

รูปที่ 3: การเริ่มต้นอินสแตนซ์ของกระบวนการ

ผลลัพธ์จะถูกพิมพ์ลงบนหน้ากระดาษหลังจากกดปุ่ม คุณควรจะสามารถหาอินสแตนซ์กระบวนการที่เกี่ยวข้องในเว็บคอนโซลของ Joget ได้เช่นกัน


Image AddedImage Removed
Figure 4: Inspecting Process Instance in Monitor Apps

...

Thai

รูปที่ 4: การตรวจสอบอินสแตนซ์กระบวนการในแอพการตรวจสอบ

เจาะลึกลงไปในอินสแตนซ์ของกิจกรรมและคุณควรจะสามารถหาอินสแตนซ์ที่กำหนดให้กับบุคคลที่ถูกต้อง


Image AddedImage Removed
Figure 5: Inspecting Activity Instance in Monitor Apps

Thai

รูปที่ 5: การตรวจสอบอินสแตนซ์ของกิจกรรมในแอพการตรวจสอบ

References

Thai

อ้างอิง