JBoss Community

Re: [jBPM4.4] custom activity has an end time before this activity is leaveds the activity

created by saig0 in jBPM - View the full discussion

A solution is to change the class UserCodeActivityBehavior:

 

 

   public void execute(ActivityExecution execution) throws Exception
    {
        ActivityBehaviour activityBehaviour = (ActivityBehaviour) customActivityReference
                .getObject(execution);
        activityBehaviour.execute(execution);
 
 
        Propagation propagation = ((ExecutionImpl) execution).getPropagation();
        if (propagation.equals(Propagation.WAIT))
            ((ExecutionImpl) execution).historyActivityStart();
        else
            ((ExecutionImpl) execution).historyAutomatic();
    }
 
 
    public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters)
            throws Exception
    {
        ExternalActivityBehaviour externalActivityBehaviour = (ExternalActivityBehaviour) customActivityReference
                .getObject(execution);
        externalActivityBehaviour.signal(execution, signalName, parameters);
 
 
        TransitionImpl transition = ((ExecutionImpl) execution).getTransition();
        if (transition != null)
            ((ExecutionImpl) execution).historyActivityEnd(transition.getName());
        else
            ((ExecutionImpl) execution).historyActivityEnd();
    }
 

Reply to this message by going to Community

Start a new discussion in jBPM at Community