public WorkflowProcess getWorkflowProcess() { return (WorkflowProcess) getProcess(); }
public void setVariable(String name, Object value) { VariableScope variableScope = (VariableScope) ((ContextContainer) getProcess()).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) getContextInstance(VariableScope.VARIABLE_SCOPE); if (variableScopeInstance == null) { throw new IllegalArgumentException("No variable scope found."); } variableScope.validateVariable(getProcessName(), name, value); variableScopeInstance.setVariable(name, value); }
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);
when(process.getVersion()).thenReturn("1.0"); when(processInstance.getProcess()).thenReturn(process); when(processInstance.getId()).thenReturn(99L); when(processInstance.getDeploymentId()).thenReturn("test");
.setState( workFlow.getState() ) .setNodeInstanceCounter( workFlow.getNodeInstanceCounter() ) .setProcessType( workFlow.getProcess().getType() ) .setParentProcessInstanceId(workFlow.getParentProcessInstanceId()) .setSignalCompletion(workFlow.isSignalCompletion())
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);
when(kruntime.getObjects(any())).thenReturn(objects); when(processInstance.getProcess()).thenReturn(process); when(processInstance.getId()).thenReturn(99L); when(processInstance.getDeploymentId()).thenReturn("test");
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); } } }
public void setVariable(String name, Object value) { VariableScope variableScope = (VariableScope) ((ContextContainer) getProcess()).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) getContextInstance(VariableScope.VARIABLE_SCOPE); if (variableScopeInstance == null) { throw new IllegalArgumentException("No variable scope found."); } variableScope.validateVariable(getProcessName(), name, value); variableScopeInstance.setVariable(name, value); }
org.jbpm.process.core.Process process = (org.jbpm.process.core.Process) instance.getProcess();
public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || ((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic() || nodeInstance instanceof CompositeNodeInstance) { if (((org.jbpm.workflow.core.WorkflowProcess) getProcess()).isAutoComplete()) { if (canComplete()) { setState(ProcessInstance.STATE_COMPLETED); } } } else { throw new IllegalArgumentException( "Completing a node instance that has no outgoing connection is not supported."); } }
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);
if (processXml != null && processXml.trim().length() > 0) { processInstance.setProcessXml( processXml ); process = processInstance.getProcess(); } else { process = ruleBase.getProcess( processId );
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);
public WorkflowProcess getWorkflowProcess() { return (WorkflowProcess) getProcess(); }
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);
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); } } }
org.jbpm.process.core.Process process = (org.jbpm.process.core.Process) instance.getProcess();
public void nodeInstanceCompleted(NodeInstance nodeInstance, String outType) { Node nodeInstanceNode = nodeInstance.getNode(); if( nodeInstanceNode != null ) { Object compensationBoolObj = nodeInstanceNode.getMetaData().get("isForCompensation"); boolean isForCompensation = compensationBoolObj == null ? false : ((Boolean) compensationBoolObj); if( isForCompensation ) { return; } } if (nodeInstance instanceof FaultNodeInstance || nodeInstance instanceof EndNodeInstance || ((org.jbpm.workflow.core.WorkflowProcess) getWorkflowProcess()).isDynamic() || nodeInstance instanceof CompositeNodeInstance) { if (((org.jbpm.workflow.core.WorkflowProcess) getProcess()).isAutoComplete()) { if (canComplete()) { setState(ProcessInstance.STATE_COMPLETED); } } } else { throw new IllegalArgumentException( "Completing a node instance that has no outgoing connection is not supported."); } }
org.kie.api.definition.process.Process oldProcess = processInstance.getProcess(); processInstance.disconnect(); processInstance.setProcess(oldProcess);