public int compare(Process o1, Process o2) { // first match by process name if (o1.getName().equals(processName) && o2.getName().equals(processName)) { // then match on version try { if( o1.getVersion() != null && o2.getVersion() != null ) { if ((Double.valueOf(o1.getVersion()) > Double.valueOf(o2.getVersion()))) { return 1; } else { return -1; } } else if( o1.getVersion() != null ) { return 1; } else { return o1.getId().compareTo(o2.getId()); } } catch (NumberFormatException e) { throw new IllegalArgumentException("Could not parse version: " + o1.getVersion() + " " + o2.getVersion(), e); } } else if (o1.getName().equals(processName)) { return 1; } return -1; } }
@Override public void copyFromSource() { if (this.id != null) { return; } this.compositeId = System.getProperty("org.kie.server.id", "") + "_" + source.getId(); this.containerId = ((WorkflowProcessInstance)source).getDeploymentId(); this.correlationKey = ((WorkflowProcessInstanceImpl)source).getCorrelationKey(); this.date = new Date(); this.id = source.getId(); this.initiator = (String) ((WorkflowProcessInstanceImpl)source).getVariable("initiator"); this.parentId = source.getParentProcessInstanceId(); this.processId = source.getProcessId(); this.processInstanceDescription = ((WorkflowProcessInstanceImpl)source).getDescription(); this.processName = source.getProcessName(); this.processVersion = source.getProcess().getVersion(); this.state = source.getState(); this.variables = ((WorkflowProcessInstanceImpl)source).getVariables(); }
.setParameter("procId", migrationSpec.getToProcessId()) .setParameter("procName", toBeProcess.getName()) .setParameter("procVersion", toBeProcess.getVersion()) .setParameter("procInstanceId", migrationSpec.getProcessInstanceId());
@Override public AuditEvent buildEvent(ProcessStartedEvent pse) { ProcessInstanceImpl pi = (ProcessInstanceImpl) pse.getProcessInstance(); ProcessInstanceLog log = new ProcessInstanceLog(pi.getId(), pi.getProcessId()); log.setExternalId(""+((KieSession) pse.getKieRuntime()).getIdentifier()); log.setProcessName(pi.getProcess().getName()); log.setProcessVersion(pi.getProcess().getVersion()); log.setStatus(ProcessInstance.STATE_ACTIVE); log.setProcessInstanceDescription( pi.getDescription() ); log.setProcessType(((WorkflowProcess)pi.getProcess()).getProcessType()); log.setSlaCompliance(pi.getSlaCompliance()); log.setSlaDueDate(pi.getSlaDueDate()); // store correlation key in its external form CorrelationKey correlationKey = (CorrelationKey) pi.getMetaData().get("CorrelationKey"); if (correlationKey != null) { log.setCorrelationKey(correlationKey.toExternalForm()); } long parentProcessInstanceId = (Long) pi.getMetaData().getOrDefault("ParentProcessInstanceId", -1L); log.setParentProcessInstanceId( parentProcessInstanceId ); return log; }
public String getVersion() { return delegate.getVersion(); }
public int compare(Process o1, Process o2) { // first match by process name if (o1.getName().equals(processName) && o2.getName().equals(processName)) { // then match on version try { if( o1.getVersion() != null && o2.getVersion() != null ) { if ((Double.valueOf(o1.getVersion()) > Double.valueOf(o2.getVersion()))) { return 1; } else { return -1; } } else if( o1.getVersion() != null ) { return 1; } else { return o1.getId().compareTo(o2.getId()); } } catch (NumberFormatException e) { throw new IllegalArgumentException("Could not parse version: " + o1.getVersion() + " " + o2.getVersion(), e); } } else if (o1.getName().equals(processName)) { return 1; } return -1; } }
return new ProcessDesc(process.getId(), process.getName(), process.getVersion() , process.getPackageName(), process.getType(), process.getKnowledgeType().name(), process.getNamespace(), "");
@Override public void copyFromSource() { if (this.id != null) { return; } this.compositeId = System.getProperty("org.kie.server.id", "") + "_" + source.getId(); this.containerId = ((WorkflowProcessInstance)source).getDeploymentId(); this.correlationKey = ((WorkflowProcessInstanceImpl)source).getCorrelationKey(); this.date = new Date(); this.id = source.getId(); this.initiator = (String) ((WorkflowProcessInstanceImpl)source).getVariable("initiator"); this.parentId = source.getParentProcessInstanceId(); this.processId = source.getProcessId(); this.processInstanceDescription = ((WorkflowProcessInstanceImpl)source).getDescription(); this.processName = source.getProcessName(); this.processVersion = source.getProcess().getVersion(); this.state = source.getState(); this.variables = ((WorkflowProcessInstanceImpl)source).getVariables(); }
public ProcessEvent(org.kie.api.event.process.ProcessEvent event) { this.processId = event.getProcessInstance().getProcessId(); this.version = event.getProcessInstance().getProcess().getVersion(); this.processInstanceId = event.getProcessInstance().getId(); this.state = event.getProcessInstance().getState(); this.processName = event.getProcessInstance().getProcessName(); }
.setParameter("procId", migrationSpec.getToProcessId()) .setParameter("procName", toBeProcess.getName()) .setParameter("procVersion", toBeProcess.getVersion()) .setParameter("procInstanceId", migrationSpec.getProcessInstanceId());
public SimulationEvent simulate(Object activity, SimulationContext context) { NodeInstance nodeInstance = (NodeInstance) activity; long startTime = context.getClock().getCurrentTime(); ProcessInstance pi = nodeInstance.getProcessInstance(); Node node = nodeInstance.getNode(); String bpmn2NodeId = (String) node.getMetaData().get("UniqueId"); String processName = pi.getProcessName(); String processVer = pi.getProcess().getVersion(); if (processVer == null) { processVer = ""; } // set end time for processinstance end time context.setMaxEndTime(context.getClock().getCurrentTime()); return new EndSimulationEvent(pi.getProcessId(), context.getProcessInstanceId(), startTime, context.getClock().getCurrentTime(), context.getStartTime(), bpmn2NodeId, node.getName(), processName, processVer); }
public SimulationEvent simulate(Object activity, SimulationContext context) { NodeInstance nodeInstance = (NodeInstance) activity; long startTime = context.getClock().getCurrentTime(); ProcessInstance pi = nodeInstance.getProcessInstance(); Node node = nodeInstance.getNode(); String bpmn2NodeId = (String) node.getMetaData().get("UniqueId"); String processName = pi.getProcessName(); String processVer = pi.getProcess().getVersion(); if (processVer == null) { processVer = ""; } // set end time for processinstance end time context.setMaxEndTime(context.getClock().getCurrentTime()); return new EndSimulationEvent(pi.getProcessId(), context.getProcessInstanceId(), startTime, context.getClock().getCurrentTime(), context.getStartTime(), bpmn2NodeId, node.getName(), processName, processVer); }
if (simInfo != null) { simInfo.setProcessName(session.getKieBase().getProcess(processId).getName()); simInfo.setProcessVersion(session.getKieBase().getProcess(processId).getVersion()); pi.getProcessName(), pi.getProcess().getVersion()));
if (simInfo != null) { simInfo.setProcessName(session.getKieBase().getProcess(processId).getName()); simInfo.setProcessVersion(session.getKieBase().getProcess(processId).getVersion()); pi.getProcessName(), pi.getProcess().getVersion()));