cancel
Showing results for 
Search instead for 
Did you mean: 

Using Activiti signals

dreambitc
Champ in-the-making
Champ in-the-making
Hi there.

I am using alfresco 4.1.9.8 and want to know is is possible to use boundary signal event against the task.
I'm gonna achieve the following: there is user task, so this task should be completed either by user or an external signal(signal is triggered to the single process by its id or better to all processes waiting for this signal) If it can be achieved, maybe some one have a code snippet how to send a signal to all or single process.

Thanks in advance.
1 REPLY 1

iblanco
Confirmed Champ
Confirmed Champ
Let's see if this helps:


    public void signalConfigurationUpdate(String departmentId, String sequenceId)
    {
        RuntimeService runtimeService = this.processEngine.getRuntimeService();
        Map<String, Object> payload = new HashMap<String, Object>();
        payload.put(VAR_SIGNALED_DEPARTMENT_ID, departmentId);
        payload.put(VAR_SIGNALED_SEQUENCE_ID, sequenceId);
        runtimeService.signalEventReceived(SIGNAL_CONFIG_UPDATED, payload);
    }


This is just for Activiti, you'll have to inject Activities Process Engine:


    public void setProcessEngine(ProcessEngine processEngine)
    {
        this.processEngine = processEngine;
    }


This signals all the processes waiting for the signal.

If you want to signal just one execution I think something like this might work:


    protected void executeImpl(Action action, NodeRef nodeRef)
    {
        String signalName = (String) action.getParameterValue(PARAM_SIGNAL_NAME);
        String executionId = (String) action.getParameterValue(PARAM_EXECUTION_ID);
        RuntimeService runtimeService = processEngine.getRuntimeService();
        runtimeService.signalEventReceived(signalName, executionId);
    }