public String toString() { final StringBuilder sb = new StringBuilder("WorkflowProcessInstance"); sb.append(getId()); sb.append(" [processId="); sb.append(getProcessId()); sb.append(",state="); sb.append(getState()); sb.append("]"); return sb.toString(); }
public void configureSLA() { String slaDueDateExpression = (String) getProcess().getMetaData().get("customSLADueDate"); if (slaDueDateExpression != null) { TimerInstance timer = configureSLATimer(slaDueDateExpression); if (timer != null) { this.slaTimerId = timer.getId(); this.slaDueDate = new Date(System.currentTimeMillis() + timer.getDelay()); this.slaCompliance = SLA_PENDING; logger.debug("SLA for process instance {} is PENDING with due date {}", this.getId(), this.slaDueDate); } } }
private void validate() { InternalRuntimeManager manager = (InternalRuntimeManager) getKnowledgeRuntime().getEnvironment().get("RuntimeManager"); if (manager != null) { // check if process instance is owned by the same manager as the one owning ksession if (hasDeploymentId() && !manager.getIdentifier().equals(getDeploymentId())) { throw new IllegalStateException("Process instance " + getId() + " is owned by another deployment " + getDeploymentId() + " != " + manager.getIdentifier()); } } }
private void handleSLAViolation() { if (slaCompliance == SLA_PENDING) { InternalKnowledgeRuntime kruntime = getKnowledgeRuntime(); InternalProcessRuntime processRuntime = (InternalProcessRuntime) kruntime.getProcessRuntime(); processRuntime.getProcessEventSupport().fireBeforeSLAViolated(this, kruntime); logger.debug("SLA violated on process instance {}", getId()); this.slaCompliance = SLA_VIOLATED; this.slaTimerId = -1; processRuntime.getProcessEventSupport().fireAfterSLAViolated(this, kruntime); } }
WorkflowProcessInstanceImpl workFlow = (WorkflowProcessInstanceImpl) processInstance; ObjectOutputStream stream = context.stream; stream.writeLong(workFlow.getId()); stream.writeUTF(workFlow.getProcessId()); stream.writeInt(workFlow.getState());
when(processInstance.getId()).thenReturn(99L); when(processInstance.getDeploymentId()).thenReturn("test"); when(processInstance.getCorrelationKey()).thenReturn("key");
when(processInstance.getId()).thenReturn(99L); when(processInstance.getDeploymentId()).thenReturn("test"); when(processInstance.getCorrelationKey()).thenReturn("key");
@SuppressWarnings("unchecked") public void signalEvent(String type, Object event) { logger.debug("Signal {} received with data {} in process instance {}", type, event, getId()); synchronized (this) { if (getState() != ProcessInstance.STATE_ACTIVE) {
.setId( workFlow.getId() ) .setProcessId( workFlow.getProcessId() ) .setState( workFlow.getState() )
process = ruleBase.getProcess( processId ); if (process == null) { throw new RuntimeException("Could not find process " + processId + " when restoring process instance " + processInstance.getId());
public String toString() { final StringBuilder sb = new StringBuilder("WorkflowProcessInstance"); sb.append(getId()); sb.append(" [processId="); sb.append(getProcessId()); sb.append(",state="); sb.append(getState()); sb.append("]"); return sb.toString(); }
public void configureSLA() { String slaDueDateExpression = (String) getProcess().getMetaData().get("customSLADueDate"); if (slaDueDateExpression != null) { TimerInstance timer = configureSLATimer(slaDueDateExpression); if (timer != null) { this.slaTimerId = timer.getId(); this.slaDueDate = new Date(System.currentTimeMillis() + timer.getDelay()); this.slaCompliance = SLA_PENDING; logger.debug("SLA for process instance {} is PENDING with due date {}", this.getId(), this.slaDueDate); } } }
private void handleSLAViolation() { if (slaCompliance == SLA_PENDING) { InternalKnowledgeRuntime kruntime = getKnowledgeRuntime(); InternalProcessRuntime processRuntime = (InternalProcessRuntime) kruntime.getProcessRuntime(); processRuntime.getProcessEventSupport().fireBeforeSLAViolated(this, kruntime); logger.debug("SLA violated on process instance {}", getId()); this.slaCompliance = SLA_VIOLATED; this.slaTimerId = -1; processRuntime.getProcessEventSupport().fireAfterSLAViolated(this, kruntime); } }
private void validate() { InternalRuntimeManager manager = (InternalRuntimeManager) getKnowledgeRuntime().getEnvironment().get("RuntimeManager"); if (manager != null) { // check if process instance is owned by the same manager as the one owning ksession if (hasDeploymentId() && !manager.getIdentifier().equals(getDeploymentId())) { throw new IllegalStateException("Process instance " + getId() + " is owned by another deployment " + getDeploymentId() + " != " + manager.getIdentifier()); } } }
WorkflowProcessInstanceImpl workFlow = (WorkflowProcessInstanceImpl) processInstance; ObjectOutputStream stream = context.stream; stream.writeLong(workFlow.getId()); stream.writeUTF(workFlow.getProcessId()); stream.writeInt(workFlow.getState());
@SuppressWarnings("unchecked") public void signalEvent(String type, Object event) { logger.debug("Signal {} received with data {} in process instance {}", type, event, getId()); synchronized (this) { if (getState() != ProcessInstance.STATE_ACTIVE) {
.setId( workFlow.getId() ) .setProcessId( workFlow.getProcessId() ) .setState( workFlow.getState() )
process = ruleBase.getProcess( processId ); if (process == null) { throw new RuntimeException("Could not find process " + processId + " when restoring process instance " + processInstance.getId());