public void actionPerformed(ActionEvent e) { Method method = (Method)mbox.getSelectedItem(); MActivity mact = vact.getMActivity(); mact.setProperty("method", method==null? null: SReflect.getMethodSignature(method), true); mact.removeParameters(); if(method!=null) { Class<?>[] ptypes = method.getParameterTypes(); if(ptypes!=null) { for(int i=0; i<ptypes.length; i++) { mact.addParameter(new MParameter(MParameter.DIRECTION_OUT, new ClassInfo(ptypes[i]), "param"+i, null)); } } } } });
/** * Get the parameters. * @return The parameters. */ public IndexMap<String, MParameter> getAllParameters(Map<String, Object> params, IModelInfo model, ClassLoader cl) { IndexMap<String, MParameter> ret = new IndexMap<String, MParameter>(parameters); if(clazz!=null) { Class<?> task = clazz.getType(cl); try { Method m = task.getMethod("getExtraParameters", new Class[]{Map.class}); ParameterMetaInfo[] ps = (ParameterMetaInfo[])m.invoke(null, new Object[]{params}); for(ParameterMetaInfo pmi: ps) { MParameter mp = new MParameter(pmi.getDirection(), pmi.getClazz(), pmi.getName(), null); // has no initial value ret.put(mp.getName(), mp); } } catch(Exception e) { // ignore } } return ret; }
inivalstr = inivalstr != null? !"null".equals(inivalstr)? inivalstr : "" : ""; UnparsedExpression inival = new UnparsedExpression(name, clazz.getTypeName(), inivalstr, null); MParameter param = new MParameter(pmis.get(i).getDirection(), clazz, name, inival); atable.addParameter(param);
inivalstr = inivalstr != null? !"null".equals(inivalstr)? inivalstr : "" : ""; UnparsedExpression inival = new UnparsedExpression(name, clazz.getTypeName(), inivalstr, null); MParameter param = new MParameter(pmis.get(i).getDirection(), clazz, name, inival); atable.addParameter(param);
parseExp(exp, model.getModelInfo().getAllImports(), cl); MParameter param = new MParameter(attrs.get("direction"), clazz, name, exp); params.add(param);
MParameter param = new MParameter(paramdir, paramclazz, paramname, paramexp); act.addParameter(param); SJavaParser.parseExpression(exp, dia.getModelInfo().getAllImports(), context.getClassLoader()); MParameter param = new MParameter(dir, new ClassInfo(clazzname), name, exp); act.addParameter(param); MParameter param = new MParameter(dir, new ClassInfo(clazzname), name, exp); act.addParameter(param);
/** * Adds a parameter. */ public void addParameter() { String name = BasePropertyPanel.createFreeName("name", new BasePropertyPanel.IndexMapContains(getBpmnActivity().getParameters())); MParameter param = new MParameter(MParameter.DIRECTION_INOUT, new ClassInfo(""), name, new UnparsedExpression(name, "", "", null)); addParameter(param); }
MParameter param = new MParameter(paramdir, new ClassInfo(paramclazz), paramname, paramexp); act.addParameter(param); SJavaParser.parseExpression(exp, dia.getModelInfo().getAllImports(), context.getClassLoader()); MParameter param = new MParameter(dir, new ClassInfo(clazzname), name, exp); act.addParameter(param); SJavaParser.parseExpression(exp, dia.getModelInfo().getAllImports(), context.getClassLoader()); MParameter param = new MParameter(dir, new ClassInfo(clazz), name, exp); act.addParameter(param);
public void run() { // To schedule a step an implicit activity is created. // In order to put the step parameter value it is necessary // to have an edge with a mapping. Otherwise the parameter // value with be deleted in process thread updateParametersBeforeStep(). MActivity act = new MActivity(); act.setName("External Step Activity: "+(cnt++)); act.setClazz(new ClassInfo(ExecuteStepTask.class)); act.addParameter(new MParameter(MParameter.DIRECTION_IN, new ClassInfo(Object[].class), "step", null)); act.setActivityType(MBpmnModel.TASK); MSequenceEdge edge = new MSequenceEdge(); edge.setTarget(act); UnparsedExpression exp = new UnparsedExpression(null, (Class<?>) null, "step", null); SJavaParser.parseExpression(exp, null, null); // edge.addParameterMapping("step", SJavaParser.parseExpression("step", null, null), null); edge.addParameterMapping("step", exp, null); act.addIncomingSequenceEdge(edge); MPool pl = pool!=null? bpmnmodel.getPool(pool): (MPool)bpmnmodel.getPools().get(0); act.setPool(pl); ProcessThread thread = new ProcessThread(""+idcnt++, act, context, BpmnInterpreter.this); thread.setLastEdge(edge); thread.setParameterValue("step", new Object[]{step, ret}); context.addExternalThread(thread); } });