@SuppressWarnings("unchecked")
@Override
protected Element invokeInternal(Element requestElement) throws Exception {
Element commonElement = requestElement.getChild("common", WORKFLOW_NAMESPACE);
ProcessStartMsg psMsg = new ProcessStartMsg();
psMsg.setExternalKey(commonElement.getChildText("externalKey", WORKFLOW_NAMESPACE));
psMsg.setProcessVariablesByElementList(commonElement.getChildren("processVariable", WORKFLOW_NAMESPACE));
psMsg.setRolesByElementList(commonElement.getChildren("role", WORKFLOW_NAMESPACE));
psMsg.setInitiator(requestElement.getChildText("initiator", WORKFLOW_NAMESPACE));
psMsg.setProcAlias(requestElement.getChildText("procAlias", WORKFLOW_NAMESPACE));
psMsg.setInstanceName(requestElement.getChildText("instanceName", WORKFLOW_NAMESPACE));
psMsg.setApprovalKey(requestElement.getChildText("approvalKey", WORKFLOW_NAMESPACE));
psMsg.setComment(requestElement.getChildText("comment", WORKFLOW_NAMESPACE));
psMsg.setMainParam(requestElement.getChildText("mainParam", WORKFLOW_NAMESPACE));
psMsg.setSubParam(requestElement.getChildText("subParam", WORKFLOW_NAMESPACE));
psMsg.setFirstTaskCompleted(Boolean.parseBoolean(requestElement.getChildText("firstTaskCompleted", WORKFLOW_NAMESPACE)));
System.out.println(psMsg);
String status = null;
List<TaskInfo> taskInfoList = null;
ProcessManagerFactoryBean pmfb = new ProcessManagerFactoryBean();
ProcessManagerRemote pm = null;
try {
pm = pmfb.getProcessManager();
ProcessManagerService pms = new ProcessManagerService(pm, null);
String newInstanceId = pms.processStart(psMsg);
pm.applyChanges();
if (StringUtils.hasText(newInstanceId) && StringUtils.hasText(psMsg.getInitiator())) {
taskInfoList = pms.getTaskInfo(newInstanceId, psMsg.getInitiator());
}
status = "S";
} catch (Exception e) {