How to reference primary BC field in an Expression - siebel

I am writing a workflow in Siebel. I have a Siebel Operation box and I want to add some logic in the Input Argument tab. What I want is to compare a workflow input parameter (Comment) with a field of the main business component (BCField).
I have something like this:
Field Input Arguments
Field: Comment
Type: Expression
Value: IIf([&Comment] IS NULL,[BCField], [&Comment])
The logic here is if the workflow parameter Comment is NULL then set Comment = BCField. Otherwise, do nothing (or Comment = Comment).
If I try this I get an error: Cannot parse expression.(SBL-BPR-00121) because Siebel doesn't recognize BCField.
There is way to do this?
Thanks.

I found how to do it:
Put the BC you whose field you want to read in the Business Component Name fielnd in the Input Arguments tab.
Field Input Arguments
Field: Comment
Type: Expression
Value: IIf([&Comment] IS NULL,[BCField], [&Comment])
Business Component Name: YourBC

Related

Vue.js - Element UI - Form validation regexp

I'd like to validate a form using vue-js 2.3 and element-ui
Apparently, they use async-validator to validate the form. The documentation is here.
Example
https://jsfiddle.net/skd3nyqh/
Problem
Uncaught Error: Unknown rule type D*([2-9]d{2})(D*)([2-9]d{2})(D*)(d{4})D*
I do not know how to validate a field with regexp. I find the documentation not explicit enough on that topic.
From the documentation.
Pattern
The pattern rule property indicates a regular expression that the
value must match to pass validation.
Use
{required: true, pattern:/\D*([2-9]\d{2})(\D*)([2-9]\d{2})(\D*)(\d{4})\D*/, message: 'Please input phone', trigger: 'blur' }
Updated fiddle.

using regex in searching for a field using get_field_by_name

I am trying to get a uvm register field by name in systemverilog. I want to use regex, so that I can use a pattern for the field name. Here is my register fields:
YY_XXX_2_N
ZZ_BBB_3_N
UU_AAA_8_N
MM_CCC_4_N
YY_WWW_9_N
as you can see all register fields are ending with _N, I used the following code to get register field:
field=env.my_regmap.get_field_by_name("_N$");
so I want this code to get A register field matching the provided pattern. with the code above, I am getting the following error:
reporter [RegModel] Unable to locate field '_N$' in block 'my_regmap'
I wonder if there is a way to use regex in this situation.
Thanks!
get_field_by_name() needs an exact match to return a single handle to a field. What you need to do is use get_fields() to build the list of fields, and then use the SV find()
uvm_field_reg all_fields[$], selected_fields[$];
all_fields = get_fields();
selected_fields = all_fields.find(item) with (uvm_re_match("*_N",item.get_name));
SystemVerilog does not allow to use regex directly, but UVM provides a DPI function uvm_re_match that allows you to use regexec function from regex.h library. You can read more about this here.
You cannot use this function as an argument to get_field_by_name but you can get all fields from register by calling get_fields and then check each field with uvm_re_match.

Grails Fields Plugin using field templates issue

unfortunatly I can't find any good example where use of the Grails fields plugin is made.
WIthin my app I would like to have some field rendered as a different type like text area or later the CKE editor. My domain:
class Case {
String description
}
I've created a _input.gsp that is found by the plugin:
INFO formfields.FormFieldsTemplateService - found template /patchCase/description/input
It contains:
<f:field bean="Case" property="description">
<g:textArea name="description" cols="40" rows="5" maxlength="5000" value="some default text"/>
</f:field>
However I get
ERROR errors.GrailsExceptionResolver - NotReadablePropertyException occurred when processing request: [GET] /M3PatchManage/patchCase/create
Invalid property 'description' of bean class [java.lang.String]: Bean property 'description' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?. Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag <g:form>: Error executing tag <f:all>: Error executing tag <f:field>: Invalid property 'description' of bean class [java.lang.String]: Bean property 'description' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Can any one describe how to use the customisation of fields or give a link with a good description (plugin doc is very thin)?
I'm on Grails 2.4.
I think your problem is the bean="Case" attribute. It seems the fields plugin is trying to render properties of the String "Case" rather than an instance of the Case class.
You should instead pass either the model key name of a Case instance, or the instance itself to this attribute. I would guess either of the following might work: bean="case" or bean="${case}".
Here's a Grails app of mine that makes extensive use of the fields plugin. Some example fields plugin templates are here and here's a form that uses them.
You'll notice that in almost all cases, an input field is passed as the body of the f:field tag, e.g.
<f:field bean="competition" property="code" label="Code">
<g:textField name="${property}" value="${value}" class="input-xlarge" maxlength="191"/>
</f:field>
This could be expressed more concisely as:
<f:field bean="competition" property="code" label="Code"
input-class="input-xlarge" input-maxlength="191"/>
I've been through the same issue. Try to use bean="${class}" instead of bean="class".
On "class" put the name of the class that you are trying to bean

Fake select field for Simple Form

I'm using Simple Form, and I have a few fields that are not associated with my model. I found using this fake field option to be a good solution:
https://github.com/plataformatec/simple_form/wiki/Create-a-fake-input-that-does-NOT-read-attributes
I thought this was cleaner than adding an attr_accessor value for my fields, and it works great for text input fields. I'm hoping to accomplish the same thing with a Select Field.
I found this thread, but I couldn't find anything else:
https://github.com/plataformatec/simple_form/issues/747
Has anyone found a similar option for a Fake Select Input? Thanks!
Assuming you'll use that "fake select" for UI purposes (probably as a mean to modify the form fields to present the user using Javascript?) and you don't want to deal with the value in the controller, you could just use select_tag with any field name, instead of the simple_form f.input. The value will be sent to the server, but it will be outside the model params, so you can just ignore it in the controller.
If I misunderstood your question, please clarify.
If your just trying to get the name='whatever' instead of having name='model[whatever]' I've found it easiest to just specify the name attribute in input_html { name: 'whatever', id: 'whatever' } hash which over rides the default model[attribute].
Otherwise you could create a fake_select_input.rb which would be similar to fake_input.rb but obviously use a select_tag instead and do something like as: :fake_select

Invalid keyword argument on new model entry

I have the following model:
class mark(models.Model):
title=models.CharField(max_length=35)
url=models.URLField(max_length=200)
user=models.ManyToManyField(User,blank=True)
and then I use a form to save some data to the db. My code inside the view that saves the data is:
new_mark= mark(url=request.POST['url'],
title=request.POST['title'],
user=request.user)
new_mark.save()
Of course I have all the data validation, login required validation, etc.
When I run this it throws me an unexpected
'user' is an invalid keyword argument for this function
on theuser=request.user) line. Any ideas what might be wrong?
Please provide the whole traceback and make sure your view has no function named "mark" etc (You probably also want to change mark to Mark to follow Python and Django style guides.) test via print type(mark) before the "new_mark = …" line.
Also I am not 100% sure if a ManyToMany field allows settings data like that, eg try:
new_mark= mark(url=request.POST['url'],
title=request.POST['title'])
new_mark.user.add(request.user)
new_mark.save()
And since it's an m2m field you probably want to rename the field to users.