public static Activity remoteActivity(Container container, String page) { Container.Builder parentContainerBuilder = new Container.Builder().children(INPUT_CONTAINERS).activeChildIndex(container.getOrdinal()); if (container.getOrdinal() == 1) { parentContainerBuilder .title("FSR") .button( new Button.Builder() .type(Constants.ButtonTypes.SUBMIT) .name("actionButton") .label("Create") .value("submit") .ordinal(1) .build()); } else { parentContainerBuilder.title("{{BudgetNumber}} for {{ReportPeriod}}"); if (container.getOrdinal() > 1) parentContainerBuilder.button( new Button.Builder() .type(Constants.ButtonTypes.SUBMIT) .name("actionButton") .label("Return to Previous Step") .value("reject") .action(ActionType.REJECT.name()) .ordinal(1) .build()); parentContainerBuilder .button( new Button.Builder() .type(Constants.ButtonTypes.SUBMIT) .name("actionButton") .label("Save") .value("save") .action(ActionType.SAVE.name()) .ordinal(2) .build()) .button( new Button.Builder() .type(Constants.ButtonTypes.SUBMIT) .name("actionButton") .label("Submit") .value("approve") .action(ActionType.COMPLETE.name()) .primary() .ordinal(3) .build()); } Activity.Builder builder = new Activity.Builder() .elementType(FlowElementType.START_EVENT) .usageType(ActivityUsageType.MULTI_PAGE) .action( ActionType.CREATE, new Action(parentContainerBuilder.build(), page, DataInjectionStrategy.REMOTE)) .action( ActionType.COMPLETE, new Action(Start.CONF_CONTAINER, page, DataInjectionStrategy.REMOTE)) .action( ActionType.VIEW, new Action(parentContainerBuilder.build(), page, DataInjectionStrategy.REMOTE)) .allowAttachments() .allowAny(); for (int i = 0; i < container.getOrdinal(); i++) { Container inputContainer = INPUT_CONTAINERS.get(i); builder.appendFields(inputContainer.getFields()); } return builder.build(); }