private void logDeployment(Object location, WorkflowDeployment deployment) { if (logger.isDebugEnabled()) { String title = deployment.getDefinition().getTitle(); String version = deployment.getDefinition().getVersion(); int problemLength = deployment.getProblems().length; logger.debug("Workflow deployer: Deployed process definition '" + title + "' (version " + version + ") from '" + location + "' with " + problemLength + " problems"); } }
private void logDeployment(Object location, WorkflowDeployment deployment) { if (logger.isDebugEnabled()) { String title = deployment.getDefinition().getTitle(); String version = deployment.getDefinition().getVersion(); int problemLength = deployment.getProblems().length; logger.debug("Workflow deployer: Deployed process definition '" + title + "' (version " + version + ") from '" + location + "' with " + problemLength + " problems"); } }
public void undeploy(NodeRef nodeRef) { // Ignore if the node is a working copy if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) == false) { String defName = (String)nodeService.getProperty(nodeRef, WorkflowModel.PROP_WORKFLOW_DEF_NAME); if (defName != null) { // Undeploy the workflow definition List<WorkflowDefinition> defs = workflowService.getAllDefinitionsByName(defName); for (WorkflowDefinition def: defs) { if (logger.isDebugEnabled()) logger.debug("Undeploying workflow '" + defName + "' ..."); workflowService.undeployDefinition(def.getId()); if (logger.isDebugEnabled()) logger.debug("... undeployed '" + def.getId() + "' v" + def.getVersion()); } } } else { if (logger.isDebugEnabled()) logger.debug("Workflow deployer: Definition '" + nodeRef + "' not undeployed since it is a working copy"); } }
public void undeploy(NodeRef nodeRef) { // Ignore if the node is a working copy if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) == false) { String defName = (String)nodeService.getProperty(nodeRef, WorkflowModel.PROP_WORKFLOW_DEF_NAME); if (defName != null) { // Undeploy the workflow definition List<WorkflowDefinition> defs = workflowService.getAllDefinitionsByName(defName); for (WorkflowDefinition def: defs) { if (logger.isDebugEnabled()) logger.debug("Undeploying workflow '" + defName + "' ..."); workflowService.undeployDefinition(def.getId()); if (logger.isDebugEnabled()) logger.debug("... undeployed '" + def.getId() + "' v" + def.getVersion()); } } } else { if (logger.isDebugEnabled()) logger.debug("Workflow deployer: Definition '" + nodeRef + "' not undeployed since it is a working copy"); } }
logger.debug("... undeployed '" + def.getId() + "' v" + def.getVersion());
logger.debug("... undeployed '" + def.getId() + "' v" + def.getVersion());
@Test public void testGetDefinitionByName() throws Exception { WorkflowDefinition definition = deployTestTaskDefinition(); WorkflowDefinition result = workflowEngine.getDefinitionByName(definition.getName()); assertNotNull("The workflow definition was not found!", result); assertEquals(definition.getId(), result.getId()); assertEquals(definition.getDescription(), result.getDescription()); assertEquals(definition.getName(), result.getName()); assertEquals(definition.getTitle(), result.getTitle()); assertEquals(definition.getVersion(), result.getVersion()); workflowEngine.undeployDefinition(definition.getId()); WorkflowDefinition nullResult = workflowEngine.getDefinitionByName(definition.getName()); assertNull("The workflow definition was found but should be null!", nullResult); }
out.println("id: " + def.getId() + " , name: " + def.getName() + " , title: " + def.getTitle() + " , version: " + def.getVersion()); for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName() + " v" + workflow.getDefinition().getVersion()); out.println("deployed definition id: " + def.getId() + " , name: " + def.getName() + " , title: " + def.getTitle() + " , version: " + def.getVersion()); currentDeployEngine = command[1]; currentDeployResource = command[2]; out.print(" v" + def.getVersion()); out.println("definition: " + ((currentWorkflowDef == null) ? "None" : currentWorkflowDef.getId() + " , name: " + currentWorkflowDef.getTitle() + " , version: " + currentWorkflowDef.getVersion())); out.println("workflow: " + ((currentPath == null) ? "None" : currentPath.getInstance().getId() + " , active: " + currentPath.getInstance().isActive())); out.println("path: " + ((currentPath == null) ? "None" : currentPath.getId() + " , node: " + currentPath.getNode().getTitle()));
out.println("id: " + def.getId() + " , name: " + def.getName() + " , title: " + def.getTitle() + " , version: " + def.getVersion()); for (WorkflowInstance workflow : workflows) out.println("id: " + workflow.getId() + " , desc: " + workflow.getDescription() + " , start date: " + workflow.getStartDate() + " , def: " + workflow.getDefinition().getName() + " v" + workflow.getDefinition().getVersion()); out.println("deployed definition id: " + def.getId() + " , name: " + def.getName() + " , title: " + def.getTitle() + " , version: " + def.getVersion()); currentDeployEngine = command[1]; currentDeployResource = command[2]; out.print(" v" + def.getVersion()); out.println("definition: " + ((currentWorkflowDef == null) ? "None" : currentWorkflowDef.getId() + " , name: " + currentWorkflowDef.getTitle() + " , version: " + currentWorkflowDef.getVersion())); out.println("workflow: " + ((currentPath == null) ? "None" : currentPath.getInstance().getId() + " , active: " + currentPath.getInstance().isActive())); out.println("path: " + ((currentPath == null) ? "None" : currentPath.getId() + " , node: " + currentPath.getNode().getTitle()));
@Test public void testGetDefinitionById() throws Exception { WorkflowDefinition definition = deployTestTaskDefinition(); WorkflowDefinition result = workflowEngine.getDefinitionById(definition.getId()); assertNotNull("The workflow definition was not found!", result); assertEquals(definition.getId(), result.getId()); assertEquals(definition.getDescription(), result.getDescription()); assertEquals(definition.getName(), result.getName()); assertEquals(definition.getTitle(), result.getTitle()); assertEquals(definition.getVersion(), result.getVersion()); WorkflowTaskDefinition resultStartDef = result.getStartTaskDefinition(); assertNotNull("Start task is null!", resultStartDef); WorkflowTaskDefinition originalStartDef = definition.getStartTaskDefinition(); assertEquals("Start task Id does not match!", originalStartDef.getId(), resultStartDef.getId()); WorkflowNode resultNode = resultStartDef.getNode(); assertNotNull("Start Task Node is null!", resultNode); assertEquals("Start Task Node Name does not match!", originalStartDef.getNode().getName(), resultNode.getName()); TypeDefinition metaData = resultStartDef.getMetadata(); assertNotNull("Start Task Metadata is null!", metaData); assertEquals("Start Task Metadata name does not match!", originalStartDef.getMetadata().getName(), metaData.getName()); workflowEngine.undeployDefinition(definition.getId()); WorkflowDefinition nullResult = workflowEngine.getDefinitionById(definition.getId()); assertNull("The workflow definition was found but should be null!", nullResult); }
private void checkDefinition(WorkflowDefinition expDef, WorkflowDefinition actualDef) { assertEquals(expDef.getId(), actualDef.getId()); assertEquals(expDef.getName(), actualDef.getName()); assertEquals(expDef.getDescription(), actualDef.getDescription()); assertEquals(expDef.getTitle(), actualDef.getTitle()); assertEquals(expDef.getVersion(), actualDef.getVersion()); }