private WorkflowService getWorkflowService() { return this.services.getWorkflowService(); }
private WorkflowService getWorkflowService() { return this.services.getWorkflowService(); }
/** * Cancel workflow instance */ public void cancel() { serviceRegistry.getWorkflowService().cancelWorkflow(this.id); }
/** * Deletes workflow instance. * @since 3.4.9 */ public void remove() { serviceRegistry.getWorkflowService().deleteWorkflow(this.id); } }
/** * Cancel workflow instance */ public void cancel() { serviceRegistry.getWorkflowService().cancelWorkflow(this.id); }
/** * Deletes workflow instance. * @since 3.4.9 */ public void remove() { serviceRegistry.getWorkflowService().deleteWorkflow(this.id); } }
/** * Signal a transition to another node in the workflow * * @param transitionId ID of the transition to follow (or null, for the default transition) * @return the updated workflow path */ public JscriptWorkflowPath signal(String transitionId) { WorkflowPath path = serviceRegistry.getWorkflowService().signal(this.id, transitionId); return new JscriptWorkflowPath(path, this.serviceRegistry, this.scope); } }
/** * Signal a transition to another node in the workflow * * @param transitionId ID of the transition to follow (or null, for the default transition) * @return the updated workflow path */ public JscriptWorkflowPath signal(String transitionId) { WorkflowPath path = serviceRegistry.getWorkflowService().signal(this.id, transitionId); return new JscriptWorkflowPath(path, this.serviceRegistry, this.scope); } }
/** * Get task by id * * @param id task id * @return the task (null if not found) */ public JscriptWorkflowTask getTask(String id) { WorkflowTask task = services.getWorkflowService().getTaskById(id); return task == null ? null : new JscriptWorkflowTask(task, services, this.getScope()); }
/** * Get deployed workflow definition by ID * * @param id the workflow definition ID * @return the workflow definition matching the given ID */ public JscriptWorkflowDefinition getDefinition(String id) { WorkflowDefinition definition = services.getWorkflowService().getDefinitionById(id); return definition == null ? null : new JscriptWorkflowDefinition(definition, services, getScope()); }
/** * Get deployed workflow definition by Name * * @param name the workflow definition name * @return the workflow definition matching the given name */ public JscriptWorkflowDefinition getDefinitionByName(String name) { WorkflowDefinition cmrWorkflowDefinition = services.getWorkflowService().getDefinitionByName(name); return cmrWorkflowDefinition == null ? null: new JscriptWorkflowDefinition(cmrWorkflowDefinition, services, getScope()); }
/** * Create a workflow package (a container of content to route through a workflow) * * @return the created workflow package */ public ScriptNode createPackage() { NodeRef node = services.getWorkflowService().createPackage(null); return new ScriptNode(node, services, getScope()); }
/** * Get task by id * * @param id task id * @return the task (null if not found) */ public JscriptWorkflowTask getTask(String id) { WorkflowTask task = services.getWorkflowService().getTaskById(id); return task == null ? null : new JscriptWorkflowTask(task, services, this.getScope()); }
/** * Get deployed workflow definition by ID * * @param id the workflow definition ID * @return the workflow definition matching the given ID */ public JscriptWorkflowDefinition getDefinition(String id) { WorkflowDefinition definition = services.getWorkflowService().getDefinitionById(id); return definition == null ? null : new JscriptWorkflowDefinition(definition, services, getScope()); }
/** * Get deployed workflow definition by Name * * @param name the workflow definition name * @return the workflow definition matching the given name */ public JscriptWorkflowDefinition getDefinitionByName(String name) { WorkflowDefinition cmrWorkflowDefinition = services.getWorkflowService().getDefinitionByName(name); return cmrWorkflowDefinition == null ? null: new JscriptWorkflowDefinition(cmrWorkflowDefinition, services, getScope()); }
/** * Get Workflow Instance by ID * * @param workflowInstanceID ID of the workflow instance to retrieve * @return the workflow instance for the given ID */ public JscriptWorkflowInstance getInstance(String workflowInstanceID) { WorkflowInstance instance = services.getWorkflowService().getWorkflowById(workflowInstanceID); return instance == null ? null : new JscriptWorkflowInstance(instance, services, getScope()); }
/** * Create a workflow package (a container of content to route through a workflow) * * @return the created workflow package */ public ScriptNode createPackage() { NodeRef node = services.getWorkflowService().createPackage(null); return new ScriptNode(node, services, getScope()); }
/** * Get Workflow Instance by ID * * @param workflowInstanceID ID of the workflow instance to retrieve * @return the workflow instance for the given ID */ public JscriptWorkflowInstance getInstance(String workflowInstanceID) { WorkflowInstance instance = services.getWorkflowService().getWorkflowById(workflowInstanceID); return instance == null ? null : new JscriptWorkflowInstance(instance, services, getScope()); }
/** * Gets all versions of the deployed workflow definitions * * @return all versions of the deployed workflow definitions */ public Scriptable getAllDefinitions() { List<WorkflowDefinition> cmrDefinitions = services.getWorkflowService().getAllDefinitions(); ArrayList<Serializable> workflowDefs = new ArrayList<Serializable>(); for (WorkflowDefinition cmrDefinition : cmrDefinitions) { workflowDefs.add(new JscriptWorkflowDefinition(cmrDefinition, services, getScope())); } return (Scriptable)new ValueConverter().convertValueForScript(services, getScope(), null, workflowDefs); }
@Before public void before() throws Exception { ServiceRegistry registry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY); this.workflowService = registry.getWorkflowService(); this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent"); this.nodeService = registry.getNodeService(); this.transactionHelper = (RetryingTransactionHelper) this.applicationContext .getBean("retryingTransactionHelper"); this.activitiProcessEngine = (ProcessEngine) this.applicationContext.getBean("activitiProcessEngine"); MutableAuthenticationService authenticationService = registry.getAuthenticationService(); PersonService personService = registry.getPersonService(); this.personManager = new TestPersonManager(authenticationService, personService, nodeService); authenticationComponent.setSystemUserAsCurrentUser(); }