建立工單

語言: CN / TW / HK
MaximoConnector mc = new MaximoConnector(new Options().user("maxadmin").password("maxAdmin123").mt(false).lean(true)
										 .auth("maxauth").host("192.168.43.200").port(9080)).debug(true);
try {
	mc.connect();

	ResourceSet syncSet = mc.resourceSet("OSLCWODETAIL");
	JsonObject createSyncObj = Json.createObjectBuilder()
		.add("spi_wm:orgid", "EAGLENA")
		.add("spi_wm:siteid", "BEDFORD")
		.add("spi_wm:woclass", "WORKORDER")
		.add("oslc:shortTitle", "DF0000")
		.add("spi:status", "WAPPR").build();
	Resource syncRes = syncSet.sync(createSyncObj);
	Util.jsonPrettyPrinter(syncRes.getURI());			

	mc.disconnect();
} catch (IOException | OslcException e) {
	e.printStackTrace();
}