Updated value-getter.ts
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { actionAddins } from ".";
|
||||
import { IAction,IActionResult, IActionNode, IActionProperty, IField} from "../types/ActionTypes";
|
||||
import { IAction,IActionResult, IActionNode, IActionProperty, IField, IContext} from "../types/ActionTypes";
|
||||
/**
|
||||
* アクションの属性定義
|
||||
*/
|
||||
interface IGetValueProps{
|
||||
field:IField;//チェックするフィールドの対象
|
||||
verName:string;
|
||||
}
|
||||
/**
|
||||
* 正規表現チェックアクション
|
||||
@@ -18,6 +19,7 @@ export class GetValueAciton implements IAction{
|
||||
this.actionProps=[];
|
||||
this.props={
|
||||
field:{code:''},
|
||||
verName:''
|
||||
}
|
||||
//アクションを登録する
|
||||
this.register();
|
||||
@@ -28,7 +30,7 @@ export class GetValueAciton implements IAction{
|
||||
* @param event
|
||||
* @returns
|
||||
*/
|
||||
async process(actionNode:IActionNode,event:any):Promise<IActionResult> {
|
||||
async process(actionNode:IActionNode,event:any,context:IContext):Promise<IActionResult> {
|
||||
let result={
|
||||
canNext:true,
|
||||
result:false
|
||||
@@ -36,7 +38,7 @@ export class GetValueAciton implements IAction{
|
||||
try{
|
||||
//属性設定を取得する
|
||||
this.actionProps=actionNode.actionProps;
|
||||
if (!('field' in actionNode.ActionValue)) {
|
||||
if (!('field' in actionNode.ActionValue) && !('verName' in actionNode.ActionValue)) {
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -44,7 +46,7 @@ export class GetValueAciton implements IAction{
|
||||
//条件式の計算結果を取得
|
||||
const record = event.record;
|
||||
const value = record[this.props.field.code].value;
|
||||
console.log(value)
|
||||
context.variables[this.props.verName] = value;
|
||||
result = {
|
||||
canNext:true,
|
||||
result:true
|
||||
|
||||
Reference in New Issue
Block a user