@Test public void testUnsetVariableFieldRendersEmptyString() { TextTemplate template = parse("{{user.firstName}}"); WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl(); workflowInstance.configuration = configuration; workflowInstance.workflowInstance = workflowInstance; workflowInstance.nextVariableInstanceId = 1l; workflowInstance.setVariableValue("user", new HashMap<>()); assertEquals("", template.resolve(workflowInstance)); }
public void assertResolveTemplate(String expected, TextTemplate tt) { WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl(); workflowInstance.configuration = configuration; workflowInstance.workflowInstance = workflowInstance; workflowInstance.nextVariableInstanceId = 1l; workflowInstance.setVariableValue("v1", "x"); workflowInstance.setVariableValue("v2", "y"); assertEquals(expected, tt.resolve(workflowInstance)); }
/** first part of starting a new workflow instance: creating the workflow instance and applying the trigger data */ public WorkflowInstanceImpl startInitialize(TriggerInstance triggerInstance) { WorkflowId workflowId = getLatestWorkflowId(triggerInstance); WorkflowImpl workflow = getWorkflowImpl(workflowId); LockImpl lock = new LockImpl(); lock.setTime(Time.now()); lock.setOwner(getId()); WorkflowInstanceId workflowInstanceId = triggerInstance.getWorkflowInstanceId(); if (workflowInstanceId==null) { workflowInstanceId = workflowInstanceStore.generateWorkflowInstanceId(); } WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl( configuration, workflow, workflowInstanceId, triggerInstance, lock, triggerInstance.getTransientData()); if (log.isDebugEnabled()) log.debug("Created "+workflowInstance); if (workflow.trigger!=null) { workflow.trigger.applyTriggerData(workflowInstance, triggerInstance); } else { workflowInstance.setVariableValues(triggerInstance); } notifyWorkflowInstanceStarted(workflowInstance); return workflowInstance; }
return null; WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl(); workflowInstance.id = readWorkflowInstanceId(dbWorkflowInstance, _ID); workflowInstance.businessKey = readString(dbWorkflowInstance, BUSINESS_KEY);
return null; WorkflowInstanceImpl workflowInstance = new WorkflowInstanceImpl(); workflowInstance.id = readWorkflowInstanceId(dbWorkflowInstance, _ID); workflowInstance.businessKey = readString(dbWorkflowInstance, BUSINESS_KEY);