Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
absiin

Avatar / Picture

Member
Registered:
Posts: 13
Reply with quote  #1 
Aghr!

Evening everyone! This workflow ework thing is doing me in...

First of all I'm using the ancient version 6...

Asset disposal process.

I've got two fields in a form... Both drop downs... Asset & Cost Centre. The asset field is a join of the asset_code + asset_desc from the database the cost centre is a list of the cost_centre table.

asset table consists of
asset_code, asset_desc, fleet

cost centre table consists of
cost_centre, fleet

What I need is that if one of the records in either tables has the fleet column set to 1 to make the flow go to another direction... So I created a hidden text field (txtFleet) which should populate with 1 or 0 depending on the two previous fields...

For the love of me I CANNOT get this to work...

Can someone be ever so kind to explain how can I do such simple task without pulling any more of my hairs out please?

__________________
Absiin
0
Fadilk

Member
Registered:
Posts: 25
Reply with quote  #2 
I would use a check box (bool) rather than a text with int values 1/0.

Place the check box on the form as well so you can trace the value throughout the process.

Check the priority on the actions which dictate the route of the workflow.

0
KarlD

Avatar / Picture

Guru
Registered:
Posts: 113
Reply with quote  #3 
Try unhiding the field and see if a)it is being populated correctly. b)it works when not hidden. Hidden fields in version 6 can mean that the field doesn't interact with the form. You could get round this by placing the field behind another larger field. That way it will technically be hidden but available for use.

I built as asset disposal system for Northgate Vehicle Hire (65k vehicles in the UK alone at the time) and will offer whatever help I can.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #4 
Make sure the action fields (your dropdowns) have "has dependent fields" checked, and make sure your calculation field (txtfleet) has "is dependent on" checked.

You can unhide the fields to see whats going on.


0
absiin

Avatar / Picture

Member
Registered:
Posts: 13
Reply with quote  #5 
Quote:
Originally Posted by KarlD
Try unhiding the field and see if a)it is being populated correctly. b)it works when not hidden. Hidden fields in version 6 can mean that the field doesn't interact with the form. You could get round this by placing the field behind another larger field. That way it will technically be hidden but available for use.

I built as asset disposal system for Northgate Vehicle Hire (65k vehicles in the UK alone at the time) and will offer whatever help I can.


Hi Karl, 

Thank you for your response! I'm still stuck with this although I did manage to progress a bit...

I've now got a drop down with a 'Fleet' option on the cost centres and setup a %Fleet variable which is set to 1 when the fleet cost centre is chosen, that is working fine.

But there's a possibility that the person using this will choose the wrong cost centre so I want to set the %Fleet variable based on the asset type rather than the cost centre.


(%txtCostCentre = Fleet) ? (%txtFleet = TRUE):((%FleetType= 1 ) ?  (%txtFleet = TRUE):(%txtFleet=FALSE))


%FleetType:=("SELECT Fleet FROM Asset_Types WHERE Asset_Code = %txtAssetType")





It only ever works if the correct cost centre is selected... please help :)

__________________
Absiin
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #6 
Assignments are ":=" not just "=", so you are basically not assigning anything.
I believe you would be more accurate with:
(%txtCostCentre="Fleet")?(%txtFleet:=TRUE):((%FleetType=1)?(%txtFleet:=TRUE):(%txtFleet:=FALSE))

And to verify, if the Cost Center is "Fleet" you want to set txtFleet to true.
If not "Fleet" you then do a second check to see if FleetType is 1 and also set to true?
Then if not set to false.
(So txtFleet is true if Cost Center is Fleet, or FleetType is 1 regardless of the Cost Center value; otherwise its false.)
0
absiin

Avatar / Picture

Member
Registered:
Posts: 13
Reply with quote  #7 
Quote:
Originally Posted by BMellert
Assignments are ":=" not just "=", do you are basically not assigning anything.
I believe you would be more accurate with:
(%txtCostCentre="Fleet")?(%txtFleet:=TRUE):((%FleetType=1)?(%txtFleet:=TRUE):(%txtFleet:=FALSE)) 

And to verify, if the Cost Center is "Fleet" you want to set txtFleet to true.
If not "Fleet" you then do a second check to see if FleetType is 1 and also set to true?
Then if not set to false.
(So txtFleet is true if Cost Center is Fleet, or FleetType is 1 regardless of the Cost Center value; otherwise its false.)


Oops.. I'm not very good with this! Thank you :)

Now, the %FleetType isn't setting anything...

I've got:
%FleetType:=%SelectSQL("SELECT Fleet FROM Asset_Types WHERE Asset_Code = %txtAssetType")

on a separate hidden box which has the 'Field is dependent on another'.

This should take in consideration which type of asset is selected off a drop drown and accordingly check against the table which has a 1/0 fleet flag...

Doesn't work though!

__________________
Absiin
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #8 
Have you confirmed %txtAssetType has a correct value assigned?
It is a character string, or numeric?  (If character or character possible, implied by the txt prefix, you should enclose %txtAssetType in single quotes.  Presuming its numeric, that part is fine.  However, that would be the cause of it not being assigned, but could generate a conversion or "no column name" error if a character is used.)

Quote:
on a separate hidden box which has the 'Field is dependent on another'.


I'm not sure I fully understand your situation.  Is the %FleetType:=%SelectSQL(...) in the same code set (when changed or whatever) as the %txtCostCenter check/if or on a different field?  You statement implies it could be the formula in the hidden field, verses being set by the check/if.

If this is the formula for the hidden field itself, it is not formatted correctly.  If this is the case, only the %SelecSQL() should be in the formula, not an assignment.

If its being set as part of a different script, what you have done is likely correct.  The next question would then be is the %FleetType hidden field "is dependent" set correctly?

0
absiin

Avatar / Picture

Member
Registered:
Posts: 13
Reply with quote  #9 
Quote:
Originally Posted by BMellert
Have you confirmed %txtAssetType has a correct value assigned?
It is a character string, or numeric?  (If character or character possible, implied by the txt prefix, you should enclose %txtAssetType in single quotes.  Presuming its numeric, that part is fine.  However, that would be the cause of it not being assigned, but could generate a conversion or "no column name" error if a character is used.) 


Yes - The %txtAssetType it's the asset code. Transit Vans are TRVN for example.

Quote:


Quote:
on a separate hidden box which has the 'Field is dependent on another'.


I'm not sure I fully understand your situation.  Is the %FleetType:=%SelectSQL(...) in the same code set (when changed or whatever) as the %txtCostCenter check/if or on a different field?  You statement implies it could be the formula in the hidden field, verses being set by the check/if.

If this is the formula for the hidden field itself, it is not formatted correctly.  If this is the case, only the %SelecSQL() should be in the formula, not an assignment.


Uh then it might be that... I've got the FleetType being set a hidden field but not the same which checks if %Fleet=1. Although I did try to get them on the same field and it failed as well..

Quote:

If its being set as part of a different script, what you have done is likely correct.  The next question would then be is the %FleetType hidden field "is dependent" set correctly?


Yes, I believe it is. I'm trying something else this afternoon after a morning of failed attempts... I'll report in a few hours!

__________________
Absiin
0
KarlD

Avatar / Picture

Guru
Registered:
Posts: 113
Reply with quote  #10 
Sounds like this is getting a little complicated. Time for back to basics.

Firstly we need to ensure that the items that are not previously set are initialised on loading the form. This then gives us a known good state from which to begin.

It is assumed the dropdown and select statement exist and are working.

Make sure all the variables being managed by the form are visible and the data can be verified. Each of these fields will need to be set to 'is dependent' in order to be updated properly.

Ensure the fields with changeable data have been set to 'has dependents'. This is what triggers the re-evaluation of the dependent fields when the initial change is made. 

Use the builder to construct the assignments and SQL statement. This ensures that the assignments are correctly constructed.

From the point of the initial change then the following activity is required to be in the 'on change' section of the drop down field. This is where the initialisations are done and the values all checked before being used in the assignments. Try to avoid the use of nested if statements where you do not feel confident of their syntax. It is possible to make the statements mutually exclusive so only one activity is undertaken per pass.

If you use txtFleet = false as a condition of the following statements then they will only perform until the first to set txtFleet is completed.

Let me know if I can clarify any of this.




0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!