Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Set;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import ru.it.metasonic.workshop.bo1.BO1View;
- import com.jcom1.api.constants.Constants.Storage.BusinessObject20;
- import com.jcom1.api.dto.interfaces.IStorageInstanceBean;
- import com.jcom1.api.dto.interfaces.ISubjectInstanceBean;
- import com.jcom1.api.dto.interfaces.storages.IStorageInstanceItemBeanReducedToId;
- import com.jcom1.api.interfaces.IBo20AccessApi;
- import com.jcom1.api.interfaces.ICommonApi;
- import com.jcom1.api.util.IViewStorageInstanceItemPair;
- import com.jcom1.runtime.refinement.AbstractRefinement;
- import com.jcom1.runtime.refinement.FunctionStateRequest;
- import com.jcom1.runtime.refinement.FunctionStateResponse;
- import com.jcom1.runtime.refinement.RefinementGenerator;
- import de.metasonic.businessobjects.model.rules.AbstractServerAction;
- @RefinementGenerator(id = "InternalSubjectDescription_oz7BYSu2EeaVpLwktGFxww")
- public class proc1subj1Refinement extends AbstractRefinement {
- @Autowired
- ICommonApi commonApi;
- @Autowired
- IBo20AccessApi accessApi;
- /**
- * @generated
- */
- private final static Log log = LogFactory
- .getLog("com.jcom1.refinement.proc1.proc1subj1");
- private File dir, currentFile;
- private BufferedReader reader;
- /**
- * This method is called when the named function state is reached State:
- * State1 StateType: FUNCTION
- *
- * Return values "FunctionTransitionDescription_sXeAoSu2EeaVpLwktGFxww" when
- * result is "" to go to state State2
- *
- * @return return the id of the transition to follow e.g. // return new
- * FunctionStateResponse("transitionXXXXXXXX");
- */
- @RefinementGenerator(id = "FunctionStateDescription_rbzpoSu2EeaVpLwktGFxww")
- public FunctionStateResponse functionState1(
- FunctionStateRequest functionStateRequest) {
- log.debug(">>>state 1");
- String subjInstId = functionStateRequest.getSubjectInstanceId();
- try {
- ISubjectInstanceBean subjInstBean = commonApi
- .getSubjectInstanceBean(subjInstId);
- Set<IStorageInstanceBean> storages = accessApi.getStorages(
- subjInstBean, null);
- for (IStorageInstanceBean storInstBean : storages) {
- Set<IStorageInstanceItemBeanReducedToId> storItems = accessApi
- .getItems(subjInstBean, storInstBean);
- for (IStorageInstanceItemBeanReducedToId storItem : storItems) {
- String actionType = BusinessObject20.Action.READ;
- IViewStorageInstanceItemPair storInstItem = accessApi
- .getIViewAndItem(subjInstBean, storItem, actionType);
- BO1View iView = (BO1View) storInstItem.getiView();
- //log.debug("String2beafore: " + iView.getString2());
- //iView.setString2(text);
- //log.debug("String2after: " + iView.getString2());
- }
- }
- } catch (Exception e) {
- // e.printStackTrace();
- log.error(e);
- }
- return null;
- // return new
- // FunctionStateResponse("FunctionStateDescription_uiF1YyvHEeaai5222UHIUA");
- }
- /**
- * This state is an exit state Do all necessary clean up here. State: State2
- * StateType: EXIT
- */
- @RefinementGenerator(id = "FunctionStateDescription_sXeAoyu2EeaVpLwktGFxww")
- public void functionState2(FunctionStateRequest functionStateRequest) {
- log.debug(">>>state 2");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment