package impl;

import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.jpdl.internal.activity.StartActivity;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;

/**
 * @author Marjan Sterjev
 *
 */
public class Display implements ActivityBehaviour {

        private static final long serialVersionUID = 1L;

        String message;

        public Display(String message) {
                this.message = message;
        }

        public void execute(ActivityExecution execution) {
                System.out.println(message);
        }

        public static void main(String[] args) throws Throwable {
                ProcessDefinitionBuilder builder = ProcessDefinitionBuilder
                                .startProcess("Hello World");
                builder.startActivity(new StartActivity()).initial().transition(
                                "hello display").endActivity();
                builder.startActivity("hello display", new Display("Hello"))
                                .transition("world display").endActivity();
                builder.startActivity("world display", new Display("World"))
                                .endActivity();
                ProcessDefinitionImpl processDefinition = builder.endProcess();
                processDefinition.startProcessInstance();

        }
}



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240933#4240933

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240933
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to