Versions Compared

Key

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

...

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(response){
					//print returned result
					$("#responseDiv").html(response.toSource());
				  }
				}

				//start a process
				ConnectionManager.ajaxJsonp('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:1: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>

...